添加方法很奇妙:这样来
Ext.namespace("com.tsts.sunyanan");
com.tsts.sunyanan.HelloWorld = Ext.emptyFn;
Ext.apply(com.tsts.sunyanan.HelloWorld.prototype, {
name : '孙亚楠',
print:function(){
alert(String.format("输入的是: {0}", this.name));
}
});
String.format 是一个方法.具体意思一看就知道了,不多说了。
果然很有java的味道