【问题标题】:show/hide column in grid conditionally in extjs在 extjs 中有条件地显示/隐藏网格中的列
【发布时间】:2012-09-06 08:11:52
【问题描述】:

我的应用程序中有网格,我需要有条件地显示/隐藏特定列。请帮帮我。

代码:

{
    header: 'Type',  dataIndex: 'mirror',  flex: 1, sortable: true,
    renderer: function (value, meta, record, rowIndex, colIndex, store) {
                    if(value == '')
                        return "-";
                    else
                        return value;
            }
}

目前它显示- 以防没有记录,但我需要删除列以防找不到记录。

【问题讨论】:

标签: extjs


【解决方案1】:

列有一个您可以使用的hide 方法。例如,查看this example,它向您展示了如何在运行时隐藏特定列。

如果您想根据条件hide/show 列,您必须评估该条件并使用hideshow 方法。

【讨论】:

  • 我们可以在渲染器中编写这个函数吗? header: 'Job', dataIndex: 'job', flex: 1, sortable: true, renderer: function (value, meta, record, rowIndex, colIndex, store) { ------------- }
  • 是的,如果您愿意,可以在渲染器功能中使用它。问:我的回答对你有用吗?
猜你喜欢
  • 2016-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-05
  • 2013-07-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多