ExtJs006 class name, alternate name

Source: Internet
Author: User

Ext.onready (function () {    //ext.define Other Configuration Items       //alias, alternate nameExt.define ("User", {config: {name:' HHH ', Age:10}, alias:' UU ',//alias underlying code in Ext.classmangerAlternateclassname: ' UUU ',//alternate name and alias are almost//give the current class an alternate name for the underlying code in Ext.classmangerConstructorfunction(config) {//Constructors            varme = This; Me.initconfig (config); //Initialize Configuration        }            }); //var u = ext.create (' User ');     varu1 = Ext.create (' UUU ');//The user class can be created as an alias    //var u2 = ext.create (' uu ');alert (U1.getname ());//Note: Here's how to callalert (U1.getage ());ext.define (' My.sample.Person ', {config: {name: ' Mr. Unknown ', age:0, Gender: ' Male ', alias: ' UU ',//alias The underlying code in Ext.classmanger alternateclassname: ' UUU ',//Give current Class A standby            Using the name underlying code in Ext.classmanger HHH: ' AAA ', constructor:function (config) {this.initconfig (config);        return this;    }     });    var u = ext.create (' My.sample.Person ');    var u1 = ext.create (' uu ');    var U2 = ext.create (' UUU ');    alert (u2.config.name);    alert (u2.config.age);    alert (U2.HHH); */            //statics (subclasses cannot inherit) Inheritablestatics (subclasses can inherit) define static methods or properties for the current class    /*ext.define (' person ', {config: {name: ' Parent class '}, Statics: {//static method or property        static_id: ' I am the ID of the person, cannot inherit the quilt Class! '        }, Inheritablestatics: {//static method or property inheritablestatics_id: ' I am the ID of the person, I can inherit the quilt class! '            }, Constructor:function (config) {var me = this;        Me.initconfig (config);    }    }); MUST NOTE:!!!!!    The instance object is//var p = ext.create (' person ') that cannot use a static property or method;        alert (p.static_id);    To use a static property with the class name:!!!!    alert (person.static_id);    alert (person.inheritablestatics_id);    Ext.define (' User ', {extend: ' person ', config: {age:20}});  alert (user.static_id);        Undefined alert (user.inheritablestatics_id); */    /*//mixins Mixed configuration items, can be multiple inherited configuration Ext.define ("Sing", {cansing:function () {alert (' cansing method, custom ')        ;    }    });        Ext.define ("Say", {cansay:function () {alert (' Cansay,,, ');    }    });        Ext.define (' User ', {mixins: {sing: ' Sing ',///equivalent to the inherited Sing class, can be called by the User sing the method say: "Say"    }    }); var u = ext.create ("User");    Note Case U.cansay ();     U.cansing (); */         //^_^ Pseudo-code description: Requires and uses and singleton    /** Ext.define (' mycomponent '), {//may require EXT or other classes to do support//requires loading required class timing is: The current class is initialized before it is loaded//requires:[' Ext.window.Window ', ' Ext.button.Button ']//uses the class time required to load is: The current class is initialized after being loaded//uses:[' Ext.form.Panel ', ' Ext.grid.Pane    L ']//singleton:true//The current class is treated as a singleton object}); */  })

ExtJs006 class name, alternate name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.