如何清除过滤器更改tab-extjs

问题描述 投票:0回答:1

我在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个回答
0
投票

如果您在同一商店使用过滤器,它总会受到影响(使用过滤器的位置没有区别)。您可以将选项卡B上的Ext.data.ChainedStore用于选项卡A上的副本存储(筛选链式存储不会影响选项卡A上的存储)。

看起来像:

Ext.create('Ext.data.ChainedStore', {
    source: TabA.Store // Here store from tab A
});
© www.soinside.com 2019 - 2024. All rights reserved.