我正在使用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