ext grid 数据不显示
extgrid数据不显示解决方案:
1)首先看grid的数据是否获取到了;
2)若数据获取到了且数据格式正确,再看前端Ext.grid.GridPanel是否写的正确,store和列模型是否相对应,如:
new Ext.grid.ColumnModel([ new Ext.grid.CheckboxSelectionModel(), {header:'移动电话',width:100,sortable:true,[color=red]dataIndex:'mobile'[/color]}, {header:'固定电话',width:100,sortable:true,[color=red]dataIndex:'workTel'[/color]}, {header:'传真',width:100,sortable:true,[color=red]dataIndex:'fax'[/color]}, {header:'公司地址',width:100,sortable:true,[color=red]dataIndex:'address'[/color]}, {header:'邮编',width:100,sortable:true,[color=red]dataIndex:'postcode'[/color]} ]); new Ext.data.Store({ proxy:new Ext.data.MemoryProxy(gridStore), reader:new Ext.data.ArrayReader({},['mobile','workTel','fax','address','postcode']) })
3)若以上两条都没有问题,但数据就是不显示,就在store的reader中添加autoLoad:true,如:
store : new Ext.data.Store({ proxy:new Ext.data.MemoryProxy(gridStore), reader:new Ext.data.ArrayReader({},['fieldId','fieldName']), [color=red]autoLoad:true[/color] })
这样数据就能显示了
相关推荐
yangkang 2020-11-09
lbyd0 2020-11-17
sushuanglei 2020-11-12
85477104 2020-11-17
KANSYOUKYOU 2020-11-16
wushengyong 2020-10-28
lizhengjava 2020-11-13
星月情缘 2020-11-13
huangxiaoyun00 2020-11-13
luyong0 2020-11-08
腾讯soso团队 2020-11-06
Apsaravod 2020-11-05
PeterChangyb 2020-11-05
gaobudong 2020-11-04
wwwjun 2020-11-02
gyunwh 2020-11-02
EchoYY 2020-10-31
dingyahui 2020-10-30