您的位置:首页 > Web前端 > JavaScript

ExtJs 4.x 学习小记:Ext.grid.Panel禁止显示loading......

2014-03-27 14:41 459 查看
Ext.grid.Panel在通过store加载数据时,会默认显示一个 loading... 的提示,如何隐藏,可以通过下面方法实现。

第一,创建panel后,设置panel的view的loadMask属性

 fileGridPanel.view.loadMask = false;

var fileGridPanel = Ext.create('Ext.grid.Panel',{
id:'filegrid',
layout:'fit',
store:store,
autoExpandColumn:true,
columns:[
{text:'编号',dataIndex:'filecode',width:80},
{text:'文件名',dataIndex:'filename',flex:1},
{text:'扩展名',dataIndex:'fileext',hidden:true},
{text:'操作',xtype:'actioncolumn',width:80,
items:[{
iconCls:'delicon',
tooltip:'删除',
handler: deleteGridRecord
},
{
iconCls:'saveicon',
tooltip:'下载',
handler: downloadFileInGrid
},
{
iconCls:'editicon',
tooltip:'编辑',
handler: function(grid, rowIndex, colIndex){
var rec = grid.getStore().getAt(rowIndex);
setFileInfo(OPERATION_EDIT,rec);
}
}]
}],
dockedItems:[{
xtype:'toolbar',
dock:'top',
items:[searchbar]
},{
xtype:'toolbar',
dock:'top',
items:[funcbar]}],
bbar:Ext.create('Ext.PagingToolbar',{
store:store,
displayInfo:true,
displayMsg:'显示{0}-{1}条,共{2}条',
emptyMsg:'无数据'
})
});
fileGridPanel.view.loadMask = false;

第二,使用viewConfig
var fileGridPanel = Ext.create('Ext.grid.Panel',{
id:'filegrid',
layout:'fit',
store:store,
autoExpandColumn:true,
viewConfig:{
loadMask:false
},
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: