应突出显示点击行上的 ng2-smart-table

ng2-smart-table on click row should highlighted

我已经尝试解决这个问题,但无法在点击事件中突出显示行。

<ng2-smart-table [settings]="settingsPatient" [source]="sourcePatient" (userRowSelect)="patientStudy($event)" (deleteConfirm)="onDeleteConfirm($event)">"

</ng2-smart-table> 

我正在使用 angular 7,当我单击 ng2-smart-table 中的任何行时,行不会突出显示,例如,当我单击它时更改行的颜色。

这是我的行点击事件函数-(userRowSelect)="patientStudy($event)"。

选中一行后,将向其中添加 'selected' class...我们可以在此处设置行样式:

::ng-deep tbody  tr.ng2-smart-row.selected
{ background:lightblue !important; border:1px solid blue;}

working stackblitz is here

这对我有用:

::ng-deep .nb-theme-default ng2-smart-table tbody tr.selected, .nb-theme-default ng2-smart-table tbody tr:hover { background: rgb(34, 151, 190) !important; border:1px solid blue; }