ExtJS 4 Grid hide load mask

Hello,

When working with ExtJS Grid there are so many things that can happen to be a requirement.

For me one of those was not to show loading masking when grid is loaded, reloaded, refreshed etc etc.

Question was how to do it.

Well! luckily for me it turned out to be relatively simple

Ext.grid.Panel comes with a view config property that you can initialize with your custom settings

  1. viewConfig: {
  2.     // you configurations
  3. }

viewConfig property is explained here

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.Panel-cfg-viewConfig

Description says that your custom config object that will be applied to the grid’s UI view. That gives us an hint that we should be looking for settings that we can make to a Grid View

Now if you browse to this URL

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.View

You will see all sort of properties that you can make use of. One of them is loadMask.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.View-cfg-loadMask

Value of loadMask can be either true/false or LoadMask object with custom settings.

Now if you add this to you Grid then the loadMask will not appear

  1. viewConfig: {
  2.     loadMask:false
  3. }

An example Grid with no load mask will be something like this

  1. Ext.create('Ext.grid.Panel', {
  2. title: 'Names',
  3. store: YOUR_STORE,
  4. columns: [
  5. { text: 'Name', dataIndex: 'name' }
  6. ],
  7. height: 400,
  8. width: 450,
  9. renderTo: Ext.getBody(),
  10. viewConfig:{
  11. loadMask:false
  12. }
  13. });

I hope this helps

Cheers,

Advertisement

 

VN:F [1.9.22_1171]
Rating: 4.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
ExtJS 4 Grid hide load mask, 4.0 out of 5 based on 1 rating

Speak Your Mind

*

CommentLuv badge