带函数的CellClass不工作(ng-grid)

CellClass with function does not work (ng-grid)

本文关键字:ng-grid 工作 函数 CellClass      更新时间:2023-09-26

如果我写,像下面的

{ field: 'NumberOfDaysSinceFailure', displayName: 'Days on Watchlist',
        cellClass: function (grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'green';
            }
        }

它不工作

但是,如果我写成
{ field: 'NumberOfDaysSinceFailure', displayName: 'Days on Watchlist',
            cellClass: 'green'
            }

它按我的意思工作。有什么建议吗?

use cellTemplate