PDA

View Full Version : Adding / Removing Grid "Loading" Load Mask Dynamicly



raghu18
23 Jun 2015, 1:33 AM
Hey everyone,

I have multiple grids shown simultaneously, to prevent multiple loading logos when the user opens the page for first time I have disabled load mask by following property

viewConfig: {
loadMask : false,
},

But if the user manually refreshes any of the grids i need to show the loadMask for that respective grid, so is there any property which I can set to re-enable the loadMask ?

PS: I know I can handle this manually but there are too many grids and adding two listeners for each grid to set and remove load mask ? there has to be a simpler way

Jad
23 Jun 2015, 3:57 AM
Hy

Warh about http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel-method-setLoading

raghu18
23 Jun 2015, 9:28 PM
Hi, the LoadMask() function is used to set or remove Mask manually, hence I need to call LoadMask(true) before loading and LoadMask(false) after load completes.

I need a property or workaround for this to happen automatically whenever the grid loads, which also happens to be the default behavior. But the problem is onece I set loadMask : false in viewConfig, I am not able to get back to that default behaviour of automictic loadMask again

suzuki1100nz
23 Jun 2015, 11:28 PM
Hi,

The mask config is processed in the grid view onRender function - have a look at it to see what to do manually to re-enable the auto load mask.

http://docs.sencha.com/extjs/4.2.1/source/AbstractView.html#Ext-view-AbstractView-method-onRender

Would be easier to start with the load mask by default and then disable it