Take the 2-minute tour ×

enter image description here

When I start my application, my computer loads it 15 seconds. It loads a whole bunch of grids and things that I want to load dynamically.

What do I have to do if I want for those grids to be loaded "on demand"? Do I have to load controllers dynamically or just the grids? And how?

Thank you. :)

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

That depends on your application structure and the configuration of the stores. Following are some tweaks that you may apply:

  • remove autoLoad from the stores and keep in mind that you now need to care about loading if you don't apply paging or filtering. Why? Any store that you place in your controller store array will be instantiated as soon as the controller get instantiated, which is great but cause the load of the store if autoLoad is true. Based on the implementation the store will get loaded again for example a pagingToolbar will defiantly again fire a load so the first could be spared.

  • apply a sort of lazy controller loading. Meaning; only apply that controllers into the application controller array that you need right at the start. Load any other controller only when you need it by calling this.application.getController('ControllerName') within a controller or directly on the application controller. This will give you the conrtoller instance and init the controller (this is quite new, so I dunno since when this happens automatically. I check 4.1.3). Anyway, the lazy controller initialization will defer all Ext.Loader request for each of these controllers till the controller get initialized, so this will help you most I guess.

share|improve this answer
I'll try it. Thank you. –  user1509885 Dec 3 '12 at 6:58
add comment

It looks to me as if those scripts are being loaded by the ExtJS loader itself, I'd imagine it's loading what it thinks it needs due to the structure of the page based on the settings provided.

Have a read over the loader docs to get a feel for what it's doing and why:


share|improve this answer
add comment

Your Answer

