ExtJs4.2的新方式

Ext.define('My.sample.Person',{
name: 'XXX',
constructor: function(name){
if(name){
this.name = name;
}
return this;
},
eat:function(food){
alert(this.name + "正在吃:" + food);
return this;
}
});

var me = Ext.create('My.sample.Person','刘雄飞');
me.eat("板栗");

你可能感兴趣的:(jquery,extjs4,extjs新特性,extjs4.2)