ext grid 数据不显示解决方案:
1)首先看grid的数据是否获取到了;
2)若数据获取到了且数据格式正确,再看前端Ext.grid.GridPanel是否写的正确,store和列模型是否相对应,如:
3)若以上两条都没有问题,但数据就是不显示,就在store的reader中添加autoLoad:true,如:
这样数据就能显示了
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]
})这样数据就能显示了
本文介绍了解决 Extgrid 数据不显示的问题方案,包括检查数据获取情况、验证前端配置及 store 设置,最后通过启用 autoLoad 来确保数据正确加载。
3578

被折叠的 条评论
为什么被折叠?



