【问题标题】:Problems with DirectStore and baseParams in ExtJS 3.4ExtJS 3.4 中 DirectStore 和 baseParams 的问题
【发布时间】:2011-11-09 13:24:53
【问题描述】:

我在 ExtJs 3.4 的 DirectStore 中使用 baseParams 时遇到了一个奇怪的问题:尽管 baseParams 是在 store 对象中设置的,但在进行 API 调用(使用 extdirect)时,baseParams 为 NULL。我通过在“beforeLoad”期间将完整的存储对象写入控制台来检查这一点。我的商店是这样的:

this.store= new Ext.data.DirectStore({
      storeId: 'HereComesTheId',
      api: {
          read: Abc.pluginName.listSomeStuff
      },
      listeners: {
          'load': function (store, records, options) {
              Ext.each(records, function (record, index, all) {
                  if (record.data.selected === true) {
                      store.fireEvent('someThingsHappened', record, index);
                      return false;
                  }
              }, this);
          }
      },
      reader: new Ext.data.JsonReader(),
      remoteSort: false,
      autoLoad: true,
      baseParams:{
        'param1':  Ext.getCmp('Blub').param1,
        'param2': '123'
      },
  });

我也尝试过使用 setBaseParams(),但它也不起作用。 我以前用过几次商店,从来没有遇到过这样的问题。有什么想法吗?

【问题讨论】:

    标签: extjs store extjs3


    【解决方案1】:

    我自己找到了答案:我正在调用的 Extdirect API 配置错误。 action.class.php 中的公共函数设置为

    @extdirect-len 0
    

    如果函数需要一个或多个请求参数,则必须设置

    @extdirect-len 1
    

    然后您必须重新生成 extdirect API。就是这样

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多