Titouan de Bailleul
Titouan de Bailleul

Reputation: 12949

What is the purpose of Ext.require

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

Upvotes: 6

Views: 3546

Answers (1)

rdougan
rdougan

Reputation: 7225

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.

Upvotes: 8

Related Questions