如何在ui-grid
下面的 cellTemplate 中显示数据时添加条件:
$scope.status = ['Active', 'Non Active', 'Deleted'];
$scope.gridOptions = {
columnDefs: [{
field: 'code'
}, {
field: 'name'
}, {
field: 'status',
cellTemplate: '<div>{{status[row.entity.status]}}</div>'
}]
};
预期的结果应该是 row status show Active/NonActive/Deleted
。
这是plunker
提前致谢。