user1489492
user1489492

Reputation: 21

Dynamic loading in Extjs4.1.0

I am new to Extjs, I have read that in Extjs 4 it make use of dynamic loading of classes and I didn't quite get the concept. What is actually meant by dynamic loading in extjs, does it mean that it will load javascript files on demand. Eg if I have 10 different components (In a card layout lets say) but only one has to be displayed on initial load, the javascript file of rest of 9 components will not be loaded until those components has to be displayed? I tried Pandora application (Extjs 4 version) but I found that its loading all the JavaScript files to browser upfront on initial load (Even loaded javascript files for components which are not been displayed). If this is the case then what purpose dynamic loading solve?

Upvotes: 2

Views: 242

Answers (1)

dbrin
dbrin

Reputation: 15673

You got it right. If you read the guides carefully though it says that Dynamic Loading is not meant to be used in production. Meaning that loading one file at a time is not optimal, however it does help tremendously with debugging your code. The other thing it does is eliminates the need to list out all of your files one by one in the html of the page you are going to run the app. You dont have to create script tags for each class you right - and believe me with MVC app you right a lot of classes, each one in it's own file. So what to do? The recommended approach is to use the Sencha SDK build tool to concatenate and minify all of your classes, turn off Loader and just include that one file.

Makes sense?

Upvotes: 2

Related Questions