我在页面上放置了一个GridPanel,但是第一次加载的时候不显示Loading的效果,只有翻页的时候才有loading效果。请各位高手帮忙看看
代码如下
JScript code
var admingrid = new Ext.grid.GridPanel({
id: "admingrid",
store: adminStore,
sm: adminsm,
cm: admincm,
autoScroll: true,
autoExpandColumn: 7,
autoWidth: true,
border: false,
height: 180,
loadMask: true,
viewConfig: {
columnsText: "显示/隐藏列",
sortAscText: "正序排列",
sortDescText: "倒序排列",
forceFit: true
},
//分页
bbar: [new Ext.PagingToolbar({
store: adminStore,
pageSize: pageSize,
emptyMsg: "No result to display",
prevText: "上一页",
nextText: "下一页",
refreshText: "刷新",
lastText: "最后页",
firstText: "第一页",
beforePageText: "当前页",
afterPageText: "共{0}页"
}), new Ext.Toolbar.Fill()],
tbar: [{
text: "添加",
tooltip: "添加管理员",
iconCls: "addicon",
handler: addAdmin
}, "", "-", "", {
text: "编辑",
tooltip: "编辑管理员",
iconCls: "editicon",
handler: editAdminFn
}, "", "-", "", {
text: "删除",
tooltip: "删除管理员",
iconCls: "deleteicon",
handler: deleteAdminFn
}, "-", new Ext.Toolbar.Fill()],
listeners: {
'contextmenu': function(e) {
e.stopEvent();
},
'rowcontextmenu': function(grid, rowIndex, e) {
e.stopEvent();
}
},loadMask:{msg:'正在加载数据...'}
});
正确答案是。grid只有先render再load数据才有那个效果。。。楼主自己看看自己是不是这个顺序