【问题标题】:extjs list filter remote storeextjs 列表过滤远程存储
【发布时间】:2011-07-15 08:01:29
【问题描述】:

是否有一个可用的 ext js ListFilter 工作示例,其中列表选项由远程存储加载。该文档提供了“小”、“中”和“大”等硬编码选项的示例。

我希望从远程商店加载这些选项。我在这里找到了一个示例,但这会修改​​核心类 ListFilter.js 我希望避免这种情况。
http://www.sencha.com/forum/showthread.php?64234-Ext.ux.grid.filter.ListFilter-gt-loaded-store 谢谢, 考希克

【问题讨论】:

    标签: extjs


    【解决方案1】:

    这里是一个过滤器的例子。以下代码 sn-p 将在您的过滤器插件的实例化块中使用。

    filters: [{
        type: 'list',
        dataIndex: 'dataInTheStoreName', // use this as the value
        single: false,   // true for radio buttons
        labelField: 'dataInTheStoreLabel', // use this as the label
        store: new yourExampleStore()
    }.{...your other filters...}]
    

    所以只需创建一个 ExtJs 存储对象来访问您的数据,并将其附加到列表过滤器。 有很多这样的例子,例如here

    【讨论】:

      【解决方案2】:

      我已经创建了一个对你有用的工作小提琴:

      https://fiddle.sencha.com/#view/editor&fiddle/2gp6

      基本上,您使用商店声明过滤器(列表过滤器需要两者:lavel 和 id)

          text: 'Eye Color',
          dataIndex: 'eyeColor',
          filter: {
              type: 'list',
              store: filterStore,
              idField: 'id',
              labelField: 'value'
          }
      

      【讨论】:

        猜你喜欢
        • 2018-11-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-10-06
        • 2018-03-16
        • 2013-06-17
        • 1970-01-01
        • 2011-11-02
        相关资源
        最近更新 更多