日期:2014-05-16  浏览次数:20359 次

关于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); //根据你返回的数据进行处理并赋值
            }
        }
    });
});