【问题标题】:How to clear the filter on change the tab-extjs如何在更改 tab-extjs 时清除过滤器
【发布时间】:2019-03-01 12:52:55
【问题描述】:

我在 extjs 中编写新标签,它是前一个标签的副本,但数据将相同。

使用 route.jsp 文件从一个选项卡移动到另一个选项卡

说选项卡 A 是旧的,选项卡 B 是新的,两者都使用相同的 route.jsp(路由器)

GLOBAL_PERSON_FILTERS = ['name' 'age']

这是一个标签

this.MGridFilter = {
          ftype : 'filters',
          encode : true, // json encode the filter query
          local : true, // defaults to false (remote filtering)
          filters : [
              {
                type : 'list',
                dataIndex : 'endview',
                options : Indigo.GLOBAL_PERSON_FILTERS
              },

也复制了相同的选项卡 B,但选项名称已更改

 GLOBAL_TEST_PERSON_FILTERS = ['designation' 'company']

this.MGridFilter = {
          ftype : 'filters',
          encode : true, // json encode the filter query
          local : true, // defaults to false (remote filtering)
          filters : [
              {
                type : 'list',
                dataIndex : 'endview',
                options : Indigo.GLOBAL_TEST_PERSON_FILTERS
              },

但我面临的问题是,当我检查选项卡 B 中的过滤器时,选项卡 A 也会受到影响

请帮我解决这个问题

【问题讨论】:

    标签: extjs extjs4.2


    【解决方案1】:

    如果您在同一家商店使用过滤器,它总是会受到影响(使用过滤器的地方没有区别)。 您可以使用 Tab B 上的 Ext.data.ChainedStore 来复制 Tab A 上的存储(过滤器链式存储不会影响 Tab A 上的存储)。

    看起来像:

    Ext.create('Ext.data.ChainedStore', {
        source: TabA.Store // Here store from tab A
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 2013-11-15
      • 1970-01-01
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 2014-09-28
      相关资源
      最近更新 更多