【问题标题】:Ext.js Ext.grid.Panel and filtersExt.js Ext.grid.Panel 和过滤器
【发布时间】:2015-08-10 16:41:27
【问题描述】:

我有这个代码...

Ext.define("Requestor.view.main.RequestGrid", {
  extend: 'Ext.grid.Panel',     // Our base class. A grid panel.
... lots of code ...

  columns: [
... some more code ...

    {
      text: 'Status',
      dataIndex: 'status',
      renderer: function(value, metaData) {
        metaData.tdStyle = (value == 'Ready') ?
          'color:green;font-weight: bold' :
          'color:red;font-style: italic'
        return(value)
      },
      filter: { type: 'list', value: 'Ready' },
      flex: 1
     } 
... more code ...

这在页面最初加载时效果很好,如果我通过 UI 手动更改过滤器以包含其他不具有值“Ready”的行,然后出现。 (见屏幕截图)

但是,如果我尝试更改状态列的排序,过滤器会自动更改回仅显示状态值为“就绪”的行。 (见屏幕截图)

这是一个错误还是我做错了什么?

谢谢!

【问题讨论】:

    标签: javascript extjs


    【解决方案1】:

    我使用列表类型的过滤器如下->

                    {
                        type: 'list',
                        dataIndex: 'indexName',
                        labelField: 'name',
                        store: Ext.create('MyStore')
                    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-19
    • 2011-12-08
    • 1970-01-01
    • 2016-04-07
    • 2012-02-02
    • 2018-09-28
    • 2018-01-27
    • 2016-04-17
    相关资源
    最近更新 更多