Skip to main content

ExtJS4 FAQ

Extjs 4.2 FAQ:

What is Ext?
The Ext namespace (global object) encapsulates all classes, singletons, and utility methods provided by Sencha's libraries.
Ext is singleton object.

Ext.Base – all classes inherit from Ext.Base. It provides basic low-level functionality used by all classes
Ext.Class – a factory for making new classes
Ext.ClassLoader – responsible for ensuring that classes are available, loading them if they aren’t on the page already
Ext.ClassManager – kicks off class creation and manages dependencies
Ext.ComponentManger -base class for all Ext components

The onReady() function takes  a function as an argument. The onReady() function is called when the document is loaded and DOM is ready.
Adds a function to be called when the DOM is ready, and all required classes have been loaded
Ext.onReady(function () {
});


- Ext.define to signal class definition to complete.
Ext.define -> Ext.Class {
Pre-Processors: loader - extends - mixins - config - Statics => Post-Processors executed as
Post-Processors: Aliases - singleton -legacy => callback function
}

1.How to define new class in ExtJS 4:
Using Ext.define()
eg: Ext.define('App.MyClass',{ });

Question#2:
What is prefered method for creating class object?
Ext.create('className');
eg:  var temp = Ext.create('App.MyClass',{ });
// Using Ext.create
Ext.create('widget.coolpanel');

// Using the shorthand for defining widgets by xtype
var win = new Ext.widget('window');
Ext.widget('panel', { });

Question#3:
Which of the following is responsible for dynamic dependency loading?:
Ext.requires({ });

Question#4:
Which is the root class of all classes created with Ext.define
Ext.Base
All classes in Ext inherit from Ext.Base.

Question#5:
what is 'alias' ? type of alias used in Extjs?
shortcut name aliases for class names.
eg:
alias: ['widget.coolpanel'],
alias: ['plugin.ajaxpush'],

what is alternateClassName?
Defines alternate names for this class
eg:
Ext.define('Developer', {
    alternateClassName: ['Coder', 'Hacker']
    });

Question#6:
Which of the following state provider is bundled with ExtJS 4?
CookieProvider

Question#7:
Which of the following is a wrapper for DOM elements?
Ext.dom.Element

Question#8:
Which of the following is a base class for all Ext components?
Ext.ComponentManger

Question#9:
Template can be define using ?
Ext.XTemplate

Question#10:
What is xtype? purpose of xtype?
This property provides a shorter alternative to creating objects than using a full class name.
xtype improve performance by lazy instantiation.
Instead of explicitly creating components during initialization a component with an xtype can be created implicitly as an object config.
-xtype don't instantiate the class when Ext.onReady runs.
eg: xtype : 'panel'
    xtype: 'mainform'


Question#11:
Special type of component that can contain other components is called?
Custom component

Question#12:
refs in a controller represents _____.?
Reference to the UI components

Question#13:
Which of the following encapsulates a client side cache of Model objects
Store

Question#14:
Which of the following is NOT a client side proxy?
AjaxProxy
//Client-side proxy is memory proxy

Question#15:
Which proxy sends cross-domain requests?
JsonPProxy
eg: Twitter data

Question#16:
Which of the following config can be use to define endpoints for read, create, update & delete operation in the server proxy?
api

Question#17:
How can you transfer data from a Model to a Form?
Ext.form.Panel.loadRecord(model record);

Question#18:
Proxy can be define in ______?
Model and Store

Question#19:
Which of the following is NOT a type of association in the Model?
ManyToMany

How to define Hashmapin Extjs?
var map = new Ext.util.HashMap();
map.add('key1', 1);
map.add('key2', 2);
map.add('key3', 3);

OOPs concept:
Object-oriented programming is intended to promote greater flexibility and maintainability in programming,

Namespace - A container which allows developers to bundle all functionality under a unique, application-specific name.

Class - Defines the characteristics of the object. It is a template definition of variables and methods of an object.

Object - An Instance of a class.

Constructor - A method called at the moment of instantiation of an object. It usually has the same name as that of the class containing it.

Inheritance - A class can inherit characteristics from another class.
eg: extends : 'parent className'


Comments

Post a Comment

Popular posts from this blog

Ext4 Apply Store Filtering

In extjs4.1: There are many way for store filtering . Some of code i give here Filtering by single field: store . filter ( 'eyeColor' , 'Brown' );   Alternatively, if filters are configured with an  id , then existing filters store may be  replaced by new filters having the same  id . Filtering by single field: store . filter ( "email" , /\.com$/ );   Using multiple filters: store . filter ([ { property : "email" , value : /\.com$/ }, { filterFn : function ( item ) { return item . get ( "age" ) > 10 ; }} ]);   Using  Ext.util.Filter  instances instead of config objects (note that we need to specify the root config option in this case): store . filter ([ Ext . create ( ' Ext.util.Filter ' , {   property : "email" , value : /\.com$/ , root : 'data' }),   Ext . create ( ' Ext.util.Filter ' , {   filterFn : function ( item ) {   return item . get ( &

ExtJS - Grid panel features

What can we do with ExtJS GridPanel? I have to develop a lot of applications in my web app and I see that grid component of ExtJS may fit in. However, I am not aware of what all things I can do with the - off the shelf available framework pieces - available plug-ins in the marketplace and - custom development through my own developers This is a typical question that we hear from the business users who wants to design an application by keeping the framework’s capability in perspective. In this article I have tried to put the list of stuff you can do with grid and hopefully that shall enable you to take advantage of the beauty of ExtJS. Pre-requisites This article assumes that you are familiar with basics of ExtJS What are the available options? In this section I will be taking you through some of the commonly seen usage of ExtJS grid panel. While covering all the capabilities of grid may not be possible, I am sure it will be helpful for the business users who want to

EXTJS - Way to get a reference to the viewport from any controller

An easy way to get a reference to the viewport from any controller Here's an easy way to get a reference to your viewport from any controller: Ext.application({ launch: function(){ this.viewport = Ext.ComponentQuery.query('viewport')[0]; this.centerRegion = this.viewport.down('[region=center]'); } }); then, inside say, a controller, you can call this: this.application.viewport to get a reference to the viewport.