// 类的构造方法
// _cfg实际上就是对象初始化要传递的值。
// 这种写法可以减少代码量,但是肯能代码会看的不太明显,不太清楚类有哪些属性。
Test = function(_cfg){
Ext.apply(this,_cfg);
}
Test.print = function(_id,_name){
var _test = new Test({id:_id,name:_name});
_test.print();
}
Ext.apply(Test.prototype,{
print:function(){
alert(String.format("{0},{1}",this.id,this.name));
}
});
Test.print(2000,'c++');