我正在尝试根据新的 angular-ui-grid 3.0 rc12 中的值对一行进行着色,但我无法做到。以下代码用于在以前的版本(ngGrid)中工作:
$scope.gridOptions =
data: 'data.sites'
tabIndex: -1
enableSorting: true
noTabInterference: true
enableColumnResizing: true
enableCellSelection: true
columnDefs: [
{field: 'sv_name', displayName: 'Nombre'}
{field: 'sv_code', displayName: 'Placa'}
{field: 'count', displayName: 'Cuenta'}
]
rowTemplate: """<div ng-class="{green: true, blue: row.getProperty('count') === 1}"
ng-repeat="col in colContainer.renderedColumns track by col.colDef.name"
class="ui-grid-cell"
ui-grid-cell></div>"""
和相应的CSS:
.grid {
width: 100%;
height: 250px;
}
.green {
background-color: #2dff07;
color: #006400;
}
.blue {
background-color: #1fe0f0;
color: #153ff0;
}
这里的问题是表达式:
row.getProperty('count') === 1
不再像在 ngGrid 中那样工作了。关于如何在 angular-ui-grid ( ui-grid.info )中实现相同的任何猜测
非常感谢!