朱在铸先生 2017-02-06 02:36 采纳率: 100%
浏览 1501
已采纳

extjs4 问题,store.load问题

 businessQueryModule.orgInfoStore = new Ext.data.Store({
    proxy : {
        type : 'ajax',
        url : businessQueryModule.queryUtil + '!queryOrgInfo',
        reader : {
            type : 'json',
            root : "enumerationList"
        }
    },
    fields : [ {
        name : 'enumMeaning'
    }, {
        name : 'enumCode'
    } ]
});
 xtype : "combo",
    readOnly : false,
    editable : false,
    mode : 'local',
    emptyText : '请选择城市',
    valueField : 'enumCode',
    displayField : 'enumMeaning',
    triggerAction : 'all',
    listeners : {
        render : function() {
            Ext.fly(this.el).on('click',function(e,t) {
                    businessQueryModule.orgInfoStore.load({
                            params : {
                                'domainId' : Ext.getCmp(businessQueryModule.idPrefix+ 'domainId').getValue()
                            }
                    });
            });
        },
        'change' : function(obj,newValue, oldValue,eOpts) {
            Ext.getCmp(businessQueryModule.idPrefix + 'equipMentID').clearValue();
            Ext.getCmp(businessQueryModule.idPrefix + 'termID').clearValue();
            Ext.getCmp(businessQueryModule.idPrefix + 'operatorNum').clearValue();
            if(newValue == ""){
                Ext.getCmp(businessQueryModule.idPrefix + 'orgID').clearValue();
            }

        }
    },
    store : businessQueryModule.orgInfoStore,
    margin : '5 0 0 0',
    id : businessQueryModule.idPrefix
            + 'orgID',
    width : 150
}

当点击下拉框后,会先store.load一次,再在监听里面store.load一次。
共load了两次,而且第一次load应为没有传参,后台还会报错。
怎么解决这个问题,我只想在监听里面load就可以了,因为如果params写在外面会取不到对象的值。

  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 pyspark编译出错,如何解决?
      • ¥15 关于#java#的问题:nacos客户端有什么方法可以在网络断掉的时候自动读取本地缓存配置文件,网络恢复会自动连接线上的配置
      • ¥50 求ADS做WPC无线充电系统的模型图
      • ¥15 运行WGCNA代码时出现Error in merge$colors : object of type 'closure' is not subsettable
      • ¥15 C#winform 关掉当前界面,返回到上一界面,但不重新创建
      • ¥15 Multisim14.0软件安装
      • ¥15 一块GD32F105芯片的主板。怎么找RXD和TXD串口
      • ¥15 磁盘异常导致工业相机GigE传图卡顿
      • ¥20 python中使用chatgpt为什么一直连接失败
      • ¥50 使用grpc遇到的问题