我正在使用ext js。 我有組合框,我選擇一個值,並使用此值作爲參數來獲取其他值(兩個值)。現在我想將它添加到變量中,以便在除組合框之外的其他位置使用它。我怎樣才能做到這一點?如何爲Combobox的選定值傳遞參數並從數據庫中獲取參數的值
var txtEP=new Ext.form.ComboBox({
renderTo: "txtEP",
fieldLabel: 'End Point',
triggerAction: "all",
forceSelection: true,
mode:'local',
autoScroll: true,
allowBlank: false,
autoShow: true,
typeAhead:true,
store: genres,
valueField:'pincode',
displayField:'pincode',
emptyText:'Select a Start Point',
selectOnFocus:true,
listeners : {
'select' : function(){
var selVal = this.getValue();
//endpt(Global Variable) is the variable where i am trying to get this value.
endpt=store.load({url:'./genres1.php', params: {pincode: selVal}});
alert(endpt);
}
}
//valueField: 'X,Y'
});
首先感謝。但是,我現在如何使用Ext.data.Model對象的數組,請幫助新的這一點。 – Pari 2012-02-21 06:58:29
@ user1220259我添加了一些如何去解決這個問題的例子 – Geronimo 2012-02-21 16:43:52
@ user1220259如果這個問題對您有用,請不要忘記接受答案(左邊的複選標記) – Geronimo 2012-02-21 16:50:25