我能够通过应用下面的CSS在AngularJS UI网格的行模板,设置行的背景色:
.deleted {
background-color: #e3e3e3 !important;
}
它工作得很好。然而,当我添加
text-decoration: line-through !important;
它并不适用于该行中的文本。我究竟做错了什么?
貌似我也不必要添加这种风格:
.ui-grid-row .ui-grid-cell {
background-color: inherit !important;
}
并获得预期的效果,我只是不得不改变该行模板的方式如下:
$scope.gridOptions= {
rowTemplate: '<div>'+
'<div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" ' +
'class="ui-grid-cell" ' +
' ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, deleted: row.entity.deleted}" ui-grid-cell></div></div>'}
其中删除:row.entity.deleted是条件设定我的课。