PDA

View Full Version : Basic structure and (in)flexibility



cog
12 Mar 2013, 2:52 AM
I wrote an application in ExtJS 3.4, Browser Layout, which I would like to port to ... vs 4.

The application loads certain javascript files, based on a or multiple keys from an external profile. The keys define which 'modules' someone can access. This implies I cannot run the 'sencha create jsb -a index.html -p app.jsb3' and other related commands,as it compiles all the classes from the application, which I do not want. Someone may only get the javascript based on the keys in her/his profile. Is it possible to run a site on ExtJS 4 without creating the jsb files (I presume not)?

If not, is it possible to create only the ext.js file with the required components and include the specified js files (in relation to the keys) after that in the header of the page?

vadimv
12 Mar 2013, 9:38 AM
If not, is it possible to create only the ext.js file with the required components and include the specified js files (in relation to the keys) after that in the header of the page?

yes, look at Sencha CMD and customise your build files. You could use Ext.Loader to load the js files, it has loadScript() method for that, I have tried once in a test app and it worked, don't remember more details details.

In general what you want to do could be possible, for not experienced ExtJS4 users will be tricky to achieve it. But wondering what's the reason of this ? to minimise the load time or to make restrictions based on user profile. If is the second then I would build only one js file and would use Ext.ComponentLoader.
And last thought, if your app has a well defined/ modularised architecture, I mean one app with a few subapps/modules, then search in forums, there are a lot of discussions about that, only a notice with Ext 4.2 those ideas must be reconsidered, as the new version has some changes.

cog
13 Mar 2013, 4:16 AM
Vadim

I add the js files on the fly to the page within script tags to lower the number of files which go over the proxy. The content of those files is already minimised.

Thanks, I'll have a look into that.

Cheers,
Carl