亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

extJs 下拉框聯(lián)動實現(xiàn)代碼

 更新時間:2010年04月09日 13:27:19   作者:  
extJs 下拉框聯(lián)動實現(xiàn)代碼,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

// 第一個下拉框
var parentStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'loadByParentid.action?parentid=1001'
}),
reader: new Ext.data.JsonReader({
root: 'list',
id: 'id'
}, [
{name: 'id', mapping: 'id'},
{name: 'mc', mapping: 'name'}
])
});
// 第二個下拉框
var childStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
//這里是參數(shù)可以順便寫,這個數(shù)據(jù)源是在第一個下拉框select的時候load的
url: 'loadByParentid.action?parentid=1001'
}),
reader: new Ext.data.JsonReader({
root: 'list',
id: 'id'
}, [
{name: 'id', mapping: 'id'},
{name: 'mc', mapping: 'name'}
])
});

{
fieldLabel: '請選擇分類',
xtype:'combo',
store: parentStore,
valueField :"id",
displayField: "mc",
mode: 'local',
forceSelection: true,//必須選擇一項
emptyText:'請選擇分類...',//默認值
hiddenName:'interviewsDetail.parent_category',//hiddenName才是提交到后臺的input的name
editable: false,//不允許輸入
triggerAction: 'all',//因為這個下拉是只能選擇的,所以一定要設(shè)置屬性triggerAction為all,不然當(dāng)你選擇了某個選項后,你的下拉將只會出現(xiàn)匹配選項值文本的選擇項,其它選擇項是不會再顯示了,這樣你就不能更改其它選項了。
//allowBlank:false,//該選項值不能為空
id : 'parent_id',
name: 'parent',
width: 400,
listeners:{
select : function(combo, record,index){
childStore.proxy= new Ext.data.HttpProxy({url: 'loadByParentid.action?parentid=' + combo.value});
childStore.load();
}
}
},{
xtype:'combo',
store: childStore,
valueField :"id",
displayField: "mc",
//數(shù)據(jù)是在本地
mode: 'local',
forceSelection: true,//必須選擇一項
emptyText:'請選擇子分類...',//默認值
hiddenName:'interviewsDetail.child_category',//hiddenName才是提交到后臺的input的name
editable: false,//不允許輸入
triggerAction: 'all',//因為這個下拉是只能選擇的,所以一定要設(shè)置屬性triggerAction為all,不然當(dāng)你選擇了某個選項后,你的下拉將只會出現(xiàn)匹配選項值文本的選擇項,其它選擇項是不會再顯示了,這樣你就不能更改其它選項了。
//allowBlank:false,//該選項值不能為空
fieldLabel: '選擇',
id : 'child_id',
name: 'child',
width: 400
}

相關(guān)文章

最新評論