Extjs做的可编辑下拉列表,当编辑的时候会触发什么事件?var comb  = new Ext.form.ComboBox({
name:"category2",
store:moduleStore,
valueField:'valueId',
displayField:'valueName',
mode: 'local',
triggerAction: 'all',
editable:true,
readOnly: false,    
renderTo:'selectdiv',
listeners:{
select:{ 
                fn:function(combo,record,index) { 
                 catagoryName = record.get("valueId");
                 paramsObj.category = catagoryName;
                 store.load({params:paramsObj});
}
}
}
})Ext 可编辑 下拉列表

解决方案 »

  1.   


    beforequery : ( Object queryEvent )
    Fires before all queries are processed. Return false to cancel the query or set the queryEvent's cancel property to true.
    Listeners will be called with the following arguments:
    queryEvent : Object
    An object that has these properties:
    combo : Ext.form.ComboBox
    This combo box
    query : String
    The query
    forceAll : Boolean
    True to force "all" query
    cancel : Boolean
    Set to true to cancel the query
      

  2.   

    谢谢你,自己瞎搞,弄出来了,我这样做的...
    var moduleStore = new Ext.data.Store({
            proxy: new Ext.data.HttpProxy({
                url: config.basic_url+'webview/videoDay_'+'getVideoCategoryTop'
            }),
            reader: new Ext.data.JsonReader({
            totalProperty: "totalRecords",
            root: 'items',
            fields:['valueId','valueName']
            }),
            listeners: {
         datachanged: function(obj) {
    storetmp = obj;
    var invar = document.getElementById("category2").value;
    for(var i=0;i<obj.length;i++){
    var record = obj.getAt(i);
    var vn = record.get("valueName");
    if(vn.indexOf(invar)==-1){

    }
    }
    //obj.removeAll();
    }
         }
           });