Answered: Performance when setting visible attribute
Answered: Performance when setting visible attribute
Hi There,
I have an application with two grid with a toolbar on the top, click rows in each grid will cause some buttons in toolbar to show and some to hide (totally about 15 buttons). I found the process is really slow which can take 4s.
Anyone can provide some idea to speed up the process, thanks
Call Ext.suspendLayouts() before you start iterating over your buttons and when you're done call Ext.resumeLayouts(). This is available as of Ext 4.1.1.
Each and every hide and show action causes your toolbar to force a layout run which is very performance critical. So just try the above mentioned and see if it helps.
Or you could always show the button but enable / disable them (this is what I usually do so the user won't get irritated by "appearing" buttons...). By doing it this way no layout runs are necessary as there are only CSS classes applied and events are suspended.
Call Ext.suspendLayouts() before you start iterating over your buttons and when you're done call Ext.resumeLayouts(). This is available as of Ext 4.1.1.
Each and every hide and show action causes your toolbar to force a layout run which is very performance critical. So just try the above mentioned and see if it helps.
Or you could always show the button but enable / disable them (this is what I usually do so the user won't get irritated by "appearing" buttons...). By doing it this way no layout runs are necessary as there are only CSS classes applied and events are suspended.