jscode:
functionbulidform(){
varstore=newext.data.simplestore({
fields:["id","name"],
data:[[1,"item1"],[2,"item2"]]
});
varform=newext.form.formpanel({
id:"_form",
title:"panelforcomboxtest",
width:300,
height:150,
renderto:document.body,
items:[
{
id:"cbitem1",
xtype:"combo",
valuefield:"id",
displayfield:"name",
emptytext:"請選擇",
mode:"local",
value:"",
store:store,
triggeraction:"all",
listeners:{select:function(combox,record,index){
var_com=ext.getcmp("cbitem2");
if(!_com.disabled){
_com.disable();
}
}}
},
newext.form.combobox({
value:"item1",
id:"cbitem2",
triggeraction:"all"
})
]
ext.onready(bulidform);
ps:emptytext屬性,但下拉框觸發過一次時,便不會再顯示了.
jscode:
functionbulidform(){
varstore=newext.data.simplestore({
fields:["id","name"],
data:[[1,"item1"],[2,"item2"]]
});
varform=newext.form.formpanel({
id:"_form",
title:"panelforcomboxtest",
width:300,
height:150,
renderto:document.body,
items:[
{
id:"cbitem1",
xtype:"combo",
valuefield:"id",
displayfield:"name",
emptytext:"請選擇",
mode:"local",
value:"",
store:store,
triggeraction:"all",
listeners:{select:function(combox,record,index){
var_com=ext.getcmp("cbitem2");
if(!_com.disabled){
_com.disable();
}
}}
},
newext.form.combobox({
valuefield:"id",
displayfield:"name",
mode:"local",
value:"item1",
store:store,
id:"cbitem2",
triggeraction:"all"
})
]
});
}
ext.onready(bulidform);
ps:emptytext屬性,但下拉框觸發過一次時,便不會再顯示了.