ExtJs -- 07 -- Ext. define defines the process of a class
Ext. onReady (function () {// Ext defines a class Ext. define ("Person", {config: {name: "jack", age: 22}, fangfa: function () {Ext. msg. alert ("title information", "prompt content information")}, constructor: function (config) {// test constructor call and parameter passed in no // for (var attr in config) {// alert (attr + ":" + config [attr]); //} this. initConfig (config) ;}}); // you can directly obtain the attribute value of the initialized object. // var p = new Person (); // document. writeln (p. getName (); // after passing the config object parameter to the constructor through new, you can get the value from the object reference. // var p1 = new Person ({name: "tom", age: 33}); // document. write (p1.name) // recommended // This method can also be used to create an object and obtain the attribute value var p2 = Ext from the object reference. create ("Person", {name: "mary", age: 88}); document. write (p2.getName () document. write ("
") Document. write (p2.getAge ())});