【问题标题】:ng2-smart-table on click row should highlighted点击行上的 ng2-smart-table 应突出显示
【发布时间】:2019-08-06 02:14:18
【问题描述】:
我已经尝试解决该问题,但无法在点击事件中突出显示行。
<ng2-smart-table [settings]="settingsPatient" [source]="sourcePatient" (userRowSelect)="patientStudy($event)" (deleteConfirm)="onDeleteConfirm($event)">"
</ng2-smart-table>
我正在使用 angular 7,当我单击 ng2-smart-table 行中的任何行时,不会突出显示,例如,当我单击它时更改行的颜色。
这是我的行点击事件函数-(userRowSelect)="patientStudy($event)"。
【问题讨论】:
标签:
javascript
css
angular
bootstrap-4
ng2-smart-table
【解决方案1】:
当一行被选中时,'selected' 类被添加到它上面...这是我们可以使用该行样式的地方:
::ng-deep tbody tr.ng2-smart-row.selected
{ background:lightblue !important; border:1px solid blue;}
working stackblitz is here
【解决方案2】:
这对我有用:
::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; }