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

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
 	},


你可能感兴趣的:(ExtJs 4.x 学习小记:Ext.grid.Panel禁止显示loading......)