我正在使用基础设施igxGridComponent
。我正在尝试设置所选行的外观。
我尝试设置自己的 css 类:
.selected-row {
background-clor:red;
color:white;
font:bold;
}
但是,我不确定如何有条件地应用它们。我应该使用 ngClass 还是有另一种语法?
我正在使用基础设施igxGridComponent
。我正在尝试设置所选行的外观。
我尝试设置自己的 css 类:
.selected-row {
background-clor:red;
color:white;
font:bold;
}
但是,我不确定如何有条件地应用它们。我应该使用 ngClass 还是有另一种语法?
您可以使用igx-grid-theme SASS 函数创建自定义主题:
$custom-theme: igx-grid-theme(
$row-selected-background: green,
$row-selected-text-color: #000,
$row-selected-hover-background: red
);
然后将其传递给igx-grid SASS mixin:
::ng-deep {
@include igx-grid($custom-theme);
}
在这里你可以找到一个例子。