Question

I'm trying to migrate an app from Sencha-Touch 1 to Sencha-Touch 2 and I can't figure out what is the exact purpose of the following piece of code :

Ext.require([    
    'Ext.XTemplate',
    'Ext.Panel',
    'Ext.Button',
    'Ext.List',
    'Ext.Carousel',
    'Ext.NestedList'
]);

Could somebody help me out here ?

Thank you

Was it helpful?

Solution

It is used by the class system when dynamic loading is enabled in the class system. It basically tells the framework that these are the components that will be used in your application.

It also means that the SDK Tools can figure out which classes have been used in your application, and only use those when compiling and minifying your application into 1 file - because in most cases you will not use every part of the framework.

You can find more information about the class system here and information about the SDK Tools and building here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top