【问题标题】:How to queryBy/filterBy on all page of Grid Store data?如何在网格存储数据的所有页面上查询/过滤?
【发布时间】:2012-02-01 05:19:39
【问题描述】:

我有一个网格面板,其中包含显示在许多页面上的商店(使用 PagingToolbar)。

在 tbar 上,我放置按钮以根据 record.get("criterion") 查询存储中的所有数据。我试过使用 queryBy,但它没有返回。因此,我在按钮处理程序中使用了 filterBy,如下所示:

 new Ext.Button(
        {
            text: 'Query',
            icon: 'img/icon_search.gif',
            scope: this,
            handler:function(){                 
                my_store.filterBy(
                function(record, id) {
                    return record.get('field_name') == 'The Content of Field Name';               
                }); 
            }
        }
    ),

不幸的是,上面的查询(过滤器)只搜索当前页面的网格。如何从其他没有显示的页面中获取所有过滤(查询)的数据?

【问题讨论】:

    标签: button extjs gridpanel


    【解决方案1】:

    看看在你的商店使用remoteFilter,或者使用GridFilter插件。

    【讨论】:

      【解决方案2】:
      store.filterBy(function(record)
      {                                                 
          return  lines.indexOf(record.get("line_code")code)>0?true:false;
      },store.getAllRange()
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-02-18
        • 2013-11-18
        • 1970-01-01
        • 1970-01-01
        • 2011-01-25
        • 1970-01-01
        • 2019-05-15
        • 1970-01-01
        相关资源
        最近更新 更多