View Full Version : What is the use of Ext.loader.path in extjs4.1

15 Jun 2013, 3:48 AM
What is the use of Ext.loader.path in extjs4.1 .Can any provide example how to implement in the application


16 Jun 2013, 11:33 PM
You can use Ext.Loader.setPath() to tell the application where to find a set of resources. For example, if you have a collection of classes that you created in their own folder that you share between multiple applications you might make each class with a class name like: JSLibrary.panel.LoginPanel. That class would be defined in a file under someFolder/panel/LoginPanel.js.

For your application to load it dynamically (or build it into a production build with Sencha Cmd) it will need to know where to look for all things namespaced with 'JSLibrary'.

So, if someFolder (where all of your JSLibrary classes are kept) is one folder back from your root where your application lives you'd do:

Ext.Loader.setPath('JSLibrary', '../someFolder');


paths: {
JSLibrary: '../someFolder'

Now the application knows where to import all of your JSLibrary classes from.

17 Jun 2013, 10:52 PM
Hi Slemmon,
Thanks to reply .I have two application with MVC Pattern.The first application contain button view and second application contain combo.If user click the button .is it possible to show second application combo below button?

18 Jun 2013, 6:14 PM
If you have components you're sharing between two applications I'd put those components into a common directory and source them using the Loader pathing described above. That way Application A and Application B can both instantiate the same type of combobox, etc.

You'll only instantiate one Ext.application per app/webpage, but that way each application can use the same cache of shared classes.