读书人

关于Ext comboBox的监听,该如何解决

发布时间: 2012-11-09 10:18:48 作者: rapoo

关于Ext comboBox的监听
监听comboBox的select,对选中项进行数据库查询并在其他控件中显示。求思路。主要是在comboBox监听中的实现思路

[解决办法]
var test=new Ext.form.ComboBox({
fieldLabel: _(test),
triggerAction:'all',
store: prvdr_store,
emptyText :_("dfdfdfdsfdsf"),
displayField:'name',
valueField:'value',
width: 100,
typeAhead: true,
forceSelection: true,
selectOnFocus:true,
name:'prvdr',
id:'prvdr',
mode:'local',
listeners:{
select:function(combo,record,index){
var prvdr=record.get('value');
testfunction()//对应的处理函数
}
}
});
[解决办法]

JScript code
combo.on('select',function(comboBox) {    text1.setValue(comboBox.getValue());    Ext.Ajax.request({        url: '后台查询程序',        params: {参数名: 参数值比如comboBox.getValue(),            其它参数名值对        },        method: 'POST',        callback: function(options, success, response) {            if (success) {                text2.setValue(response.responseText); //根据你返回的数据进行处理并赋值            }        }    });}); 

读书人网 >JavaScript

热点推荐