当前位置:编程学习 > C#/ASP.NET >>

请求大侠帮解决 extjs 问题啊

 BranchGrid: function () {
        var aa = this.BranchStroe();
        var gridp = Ext.create('Ext.grid.Panel', {
            id: 'gridp',
            store: aa,
            columns: [
                            {
                                text: "ID", dataIndex: "RoomTypeID", renderer: function (v, p, r) {
                                    alert(aa.raw);
                                    var record = aa.getById(v);
                                    return record.data.name;
                                }
                            },
                            { text: "类型名称", dataIndex: "RoomName" }
            ],
            viewConfig: {
                trackOver: false,
                emptyText: '<h1 style="margin:20px">找不到数据</h1>'
            },
            bbar: Ext.create('Ext.PagingToolbar', {
                store: aa,
                displayInfo: true,
                displayMsg: '显示{0}-{1}条,共计{2}条',
                emptyMsg: "没有数据"
            })
        });
        return gridp;
    }
为什么renderder里取不到值啊 --------------------编程问答-------------------- 你这个store是什么类型的?会不会store里面没有值。 --------------------编程问答-------------------- BranchStroe: function () {
        var pageSize = 5;
        var store = Ext.create('Ext.data.Store', {
            storeId: 'RoomType',
            fields: ['RoomTypeID', 'RoomName'],
            pageSize: pageSize, //设置分页大小   
            proxy: {
                type: 'ajax',
                url: '/RoomType/extRoomType.ashx?meth=list',
                reader: {
                    type: 'json',
                    root: "RoomeType", //包含数据行集合的属性名字                          
                    totalProperty: 'totalCount'//获取数据总数    
                }
            },
            autoLoad: false
        });

        store.load({
            params: {
                start: 0,
                limit: pageSize
            }
        });
        return store;
    },这是数据源
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,