Process after grid was loaded completely using ExtJS

Đinh Hồng Châu picture Đinh Hồng Châu · Jun 27, 2012 · Viewed 27.2k times · Source

I am using ExtJS to load data to a grid, and I want to add some additional processes after data was put on grid completely.

My context is, after data was put on grid, I will check all rows, and mark some of them as disabled based on a specified condition and put tooltip to row (explain why it is disabled). I tried to use 2 events: 'afterrender' of Grid, and 'load' of grid's store, but they did not work.

Because grid's 'afterrender' was fired when first grid initialization, not concern to data load. store's 'load' was fired when data was prefetch to store (not render on screen), so I cannot get the row <div> to style it as disabled.

So, what is the event to detect when data was loaded and rendered completely on grid? And how can I implement this requirement?

Answer

Vasiliy Faronov picture Vasiliy Faronov · Jun 27, 2012

Have you tried viewready?

Ext.create('Ext.grid.Panel', {
    // ...
    viewConfig: {
        listeners: {
            viewready: function(view) {
                // ...
            }
        }
    }
});