Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 689
Titouan de Bailleul Avatar asked Feb 15 '12 22:02

Titouan de Bailleul


People also ask

What is the use of Ext?

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.

What is requires Extjs?

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.

What creates ext?

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.


1 Answers

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.

like image 179
rdougan Avatar answered Sep 23 '22 23:09

rdougan