【问题标题】:How to add class to a cell depending on the value of another cell in ext js grid如何根据ext js网格中另一个单元格的值向单元格添加类
【发布时间】:2011-09-15 09:46:09
【问题描述】:

这是我想尝试的,我想根据同一行中另一列的值突出显示一个单元格。我知道渲染器函数可以在渲染时设置列的样式,但是是否可以访问另一列?

【问题讨论】:

    标签: javascript extjs extjs4


    【解决方案1】:

    渲染器有一组参数。第三个参数是记录。

    renderer: function(value, metaData, record){
        var anotherColumnValue = record.get('anotherColumnDataIndex');
        // ...
    }
    

    【讨论】:

    • 我希望有类似于 getRowClass 的东西,但不幸的是我认为这必须这样做。不过,将这个函数添加到每一列似乎有点太多了。
    猜你喜欢
    • 2018-07-31
    • 2022-06-28
    • 1970-01-01
    • 2019-10-04
    • 1970-01-01
    • 2011-10-05
    • 2013-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多