1
votes

On extjs grid loading mask is shown without any external call to setloading(). Is setloading() called automatically?

Did not make any calls to setloading(), wondering how and when it handles automatically?

The problem is that it is coming sometimes and othertimes data is loading without loading mask.

So if i handle it externally then two loading masks are coming. How to disable automatic loading mask on grid?

1
would be useful to mention the version of ext however my answer goes for all ext version >= 4.0VDP

1 Answers

2
votes

I think you where checking the wrong component. You should check the loadMask on the view.

A gridpanel (alias: grid) is a panel containing a gridview (alias: tableview) Same goes for the tree A treepanel is a panel containing a treeview

you can disable the masking by setting the loadMask variable to false on the view (both for gridpanel & treepanel) See docs

You can configure it by setting it in the viewConfig

Example:

var store = Ext.create('Ext.data.Store', {
    storeId: 'simpsonsStore',
    fields:[ 'name', 'email', 'phone'],
    data: [
        { name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
        { name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
        { name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
        { name: 'Marge', email: '[email protected]', phone: '555-222-1254' }
    ]
});

grid = Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    store: store,
    viewConfig: {  //this config is passed to the view
        loadMask: false
    },
    columns: [
        { text: 'Name', dataIndex: 'name' },
        { text: 'Email', dataIndex: 'email', flex: 1 },
        { text: 'Phone', dataIndex: 'phone' }
    ],
    height: 200,
    width: 400,
    renderTo: Ext.getBody()
});

//You can access the view in code by:
view = grid.getView()

If you don't set that variable it uses defaults to create an Ext.LoadMask. So if you want to find out what's wrong with the original loadMask not showing you should debug the onBeforeLoad. That should be calling the maybeShow method just below. And that in turn should call the show method (a bit lower)