Ext.onReady(function() 
{    var MyRecord = Ext.data.Record.create([
            {name:'DicId'},
            {name:'DicType'},
            {name:'DicName'},
            {name:'ParDicId'},
            {name:'DicRe'},
            {name:'State'},
            {name:'DicA'},
            {name:'DicB'},
            {name:'DicC'},
            {name:'DicD'}
    ]);
    var dataProxy=new Ext.data.HttpProxy({url:"Login.aspx"});
    var theReader=new Ext.data.JsonReader({
    totalProperty: "results",
    root: "rows",
    id: "id"
    },MyRecord);
    var store=new Ext.data.Store({
    proxy:dataProxy,
    reader:theReader
    });
    store.load();
    new Ext.grid.GridPanel(
    {
        store:store,
        mode:'remote',
        title:'权限字典管理',
        applyTo:'grid',
        width:250,
        height:150,
        frame:true,
        columns:[
            {header:"ID",width:50,dataIndex:'DicId',sortable:true},
            {header:"字典类型",width:80,dataIndex:'DicType',sortable:true},
            {header:"字典名称",width:80,dataIndex:'DicName',sortable:true},
            {header:"父级ID",width:80,dataIndex:'ParDicId',sortable:true},
            {header:"备注",width:80,dataIndex:'DicRe',sortable:true},
            {header:"状态",width:80,dataIndex:'State',sortable:true},
            {header:"备用字段A",width:80,dataIndex:'DicA',sortable:true},
            {header:"备用字段B",width:80,dataIndex:'DicB',sortable:true},
            {header:"备用字段C",width:80,dataIndex:'DicC',sortable:true},
            {header:"备用字段D",width:80,dataIndex:'DicD',sortable:true}
        ]
    })
});

解决方案 »

  1.   

    你得到的数据格式要怎样的啊,还有你得添加renderTo这个属性
      

  2.   

    applyTo:'grid',不是和renderTo一样吗,我得到的数据是json格式的啊
      

  3.   

    在html页面上加上<div id="grid"></div>
      

  4.   

    applyTo : Ext.getBody();//这个直接加载在body上applyTo:'grid',//这人要在html 添加<div id='grid'></div>
      

  5.   

    解决了,多谢各位,好像就是id没对吧,原来写的是show,前两天有点事回家了,没及时回,不好意思啊