ext.form.reset() combox

当在配置红色部分时,如果加载的数据没有相应的字段值,使用ext.form.reset(),会清空不了选项,

出现莫名其妙的选项。

{
xtype:"combo",
            id:'qz_name_yyj_1',
triggerAction:"all",
fieldLabel:"全宗名称",
            allowBlank:false,
            blankText:'必选项',
            editable: false,
anchor:"90%",
            displayField:'name',
            // triggerAction :'all',
            valueField:'domainId',
            store:new Ext.data.JsonStore({
                     url:'${$servicePath}/ams_search_auth_service.listAllfonds', 
                     fields:['name','domainId'],
                     baseParams:{},
                     root:'result',
                     listeners:{
                        'beforeload':function(store,option){
                        }
                     }
                    
                 }),
            listeners:{
                    'select':function(combo,record,index){
                        debugger;
                        qznamerecord=record.json;
                        qznamenow=record.json.name;
                        domainid=record.json.domainId;
                        if(qznamebefore=='') {
                        qznamenow=record.json.name;
                        qznamebefore=record.json.name;
                        }
                       
                        if(qznamebefore!=qznamenow) {
                         var bm_name_yyj=Ext.getCmp('bm_name_yyj');
                             bm_name_yyj.setValue('');
                            // bm_name_yyj.lastQuery=null;
                         var dalx_name_yyj=Ext.getCmp('dalx_name_yyj');
                             dalx_name_yyj.setValue('');
                             //dalx_name_yyj.lastQuery=null;
                             qznamebefore=qznamenow;
                        } 
                    }
                   
                }
},
{
xtype:"combo",
            id:'bm_name_yyj',
            allowBlank:false,
triggerAction:"all",
fieldLabel:"部门名称",
            blankText:'必选项',
            editable: false,
anchor:"90%",
            displayField:'name',
         //   triggerAction :'all',
            valueField:'id',
            store:new Ext.data.JsonStore({
                     url:'${$servicePath}/ams_search_auth_service.listdepartmentFromDomainId', 
                     fields:['name','id'],
                     baseParams:{},
                     autoLoad:true,
                     root:'result',
                     listeners:{
                        'beforeload':function(store,option){
                         //  var domainId= Ext.getCmp('qz_name_yyj').getValue();
                          store.baseParams={domainId:domainid};
                        }
                     }
                    
                 }),
            listeners:{
            'select':function(combo,record,index){
                           bmnamerecord=record.json;
                       }
                }
},

 

你可能感兴趣的:(ExtJs)