Ext.Define function is a part of EXTJs. ExtJS is a advance javascript framework, It used to create java class and their method by using javascript.
I write the Ext.define method below :
Ext.define ( String className, Object data, Function createdFn ) : Ext.Base
Ext.define is used to define a class.
Example:
creates My.computer.NoteBook Class
Ext.define('My.computer.NoteBook', {
extend:'Ext.panel.Panel',
config: {
hardware:'Dell',
os:'Linux',
price:500
},
constructor:function(config) {
this.initConfig(config);
return this;
}
});
creates instance of My.computer.NoteBook Class
var myComputer = Ext.create('My.computer.NoteBook', {
hardware:'MacBook Pro',
os:'Mac OS X',
price:1800
});
0 Comment(s)