PDA

View Full Version : Defer refreshing grid after loading store



lacco
26 Jan 2012, 6:51 AM
Hi!

I am looking for a possibility to defer layouting/refreshing a grid: After a store is loaded, the following actions are done:

1. Adding/ removing unneeded columns (to generate columns from loaded data): grid.headerCt.add(columns)
2. Hiding/ showing relevant columns (to apply user's settings): grid.headerCt.items.each(...)
3. Filtering store (to apply client filters that can't be done through the server): grid.store.filterBy(...)

As far as I know the grid is relayouted 4 times (after load + the 3 steps mentioned above). Is there a possibility to suppress the layouting and call the layouting method manually (Ext.grid.View#refresh)?

Thanks for any help!

Izhaki
26 Jan 2012, 8:35 AM
I'm not sure this is what you're after, but have a look at store.suspendEvents(false) (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store-method-suspendEvents); it should suspend any view updates.

lacco
26 Jan 2012, 8:43 AM
But this doesn't suspend any events that results from grid.headerCt.add ? And how do I relayout a grid?

lacco
29 Jan 2012, 10:39 AM
Mh, nobody has an idea? Currently the rendering is really slow so that any hint is welcome :)