【问题标题】:how can i filter store with two fields in extjs?如何在 extjs 中使用两个字段过滤存储?
【发布时间】:2013-02-22 11:44:32
【问题描述】:

我在 extjs 中创建了 3 个商店,分别命名为章节、主题和标准。 在章节存储中,我有字段 subjectid 和 stanrdid 现在我想根据在主题和标准中选择的值过滤我的章节存储。

我可以从任何一个过滤器中过滤章节,但不能从两个 id 中过滤记录。

【问题讨论】:

  • 没有问题...
  • @MatthewBaker 阅读问题标题。有一个问号;)。
  • 我的问题是如何按商店中的 2 列过滤?

标签: php extjs filter store


【解决方案1】:

一个基本的过滤器示例如下所示。请参阅documentation。您也可以以类似的方式尝试Store.filterBy() 方法。

filters: [
    function(item) {
        if (item.subject == selectedSubject && item.standard == selectedStandard){
          return true;
        }

        return false;
    }
]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-02
    • 1970-01-01
    • 2018-03-16
    • 2021-01-03
    • 1970-01-01
    • 1970-01-01
    • 2013-07-24
    相关资源
    最近更新 更多