一般定義方式
定義一個類
Ext
welcome:function(){
alert(
}
});
使用Ext
Ext
goodBye:function(){
alert(
}
funAll:function(){
this
this
}
});
實例化類對象
var app = new Simple
app
重載的另一種寫法
Simple
// New members
});
實際例子
Ext
extend:
initComponent: function(){
var me = this;
var initEnable = true; //初始權限
}
});
Ext
mysetenable:function(b){ //增加自定義函數設置按鈕權限
if ( this
if (b){
this
}
else{
this
}
}
else{
this
}
}
});
例子
Ext
extend:
alias:
//height:
//width:
frame: true
layout:
bodyPadding:
//baseCls: "x
//defaults: { anchor: "
// anchor:
defaults:{//統一設置表單字段默認屬性
//autoFitErrors : false
labelSeparator :
labelWidth :
//width :
allowBlank : false
//blankText :
labelAlign :
msgTarget :
//msgTarget :
//msgTarget :
//msgTarget :
//msgTarget :
//msgTarget :
}
items:[{
xtype:
name:
labelWidth:
width:
queryMode:
store:TmpAddressStore
displayField:
valueField:
editable : false
forceSelection : true
msgTarget:
allowBlank: false
fieldLabel:
}
xtype:
name:
labelWidth:
width:
msgTarget:
allowBlank: false
fieldLabel:
}]
initComponent: function(){
var me = this;
var PoType =
var TmpHeadRec = Ext
Ext
buttons: [{
text:
handler:function(){
if (me
//保存功能
}
}
}
text:
handler: function () {
me
}
}]
SetFormValue:function(){ //自定義方法 obj
me
me
me
}
});
this
}
});
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20299.html