角的UI网 - 文字修饰并不适用于排模板儿童

问题描述 投票:0回答:1

我能够通过应用下面的CSS在AngularJS UI网格的行模板,设置行的背景色:

    .deleted {
        background-color: #e3e3e3 !important;
    }

它工作得很好。然而,当我添加

text-decoration: line-through !important;

它并不适用于该行中的文本。我究竟做错了什么?

css angularjs row angular-ui-grid text-decorations
1个回答
0
投票

貌似我也不必要添加这种风格:

.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是条件设定我的课。

© www.soinside.com 2019 - 2024. All rights reserved.