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
Ext JS is a popular JavaScript framework which provides rich UI for building web applications with cross-browser functionality. Ext JS is basically used for creating desktop applications. It supports all the modern browsers such as IE6+, FF, Chrome, Safari 6+, Opera 12+, etc.
Requires - All classes required to be defined for the class to be instantiated. Uses - A list of classes potentially used by the class at some point in its lifecycle, but not necessarily requried for the class to initially be instantiated. Subclasses - Classes that extend the current class.
Ext. create - to create an instance of a pre-defined class. - the class was defined using Ext. define - used to define the data and behavior of a component. which will be used later.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With