2

i have already tried to solve the issue but not able to highlight row on click event.

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

</ng2-smart-table> 

i am using angular 7 and when i click on any row in ng2-smart-table row not get highlighted e.g change colour of of row when i clicked on it.

this is my function for row click event-(userRowSelect)="patientStudy($event)".

Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70

2 Answers2

2

When a row is selected, 'selected' class is being added to it... this is where we can style the row using:

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

working stackblitz is here

Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70
0

This works for me:

::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; }

huypham99
  • 67
  • 7