html - How to highlight multiple selected row in angular 4 -


how highlight multiple selected row in angular 4 ,

here can edit checkbox , perform other action too. looking highlight row checked.

<tbody>    <tr *ngfor='let row of rowdata' [ngclass]="{ 'selected': row.selected }">      <td class="text-center>          <input type="checkbox" [(ngmodel)]="row.selected" />      </td>      <td>          <input type="text" *ngif="row.editable" [(ngmodel)]="row.name" />          <ng-container *ngif="!row.editable">{{row.name}}</ng-container>          <!-- can use span or whatever instead of ng-container-->      </td>      <!-- repeat other cells -->          </tr> </tbody> 

to highlight row, need highlight cells (<td>). know, can't highlight row.

here logic :

<tbody>    <tr *ngfor='let row of rowdata'>      <td class="text-center" [class.selected]="row.selected">          <input type="checkbox" [(ngmodel)]="row.selected" />      </td>      <td [class.selected]="row.selected">          <input type="text" *ngif="row.editable" [(ngmodel)]="row.name" />          <ng-container *ngif="!row.editable">{{row.name}}</ng-container>          <!-- can use span or whatever instead of ng-container-->      </td>      <!-- repeat other cells -->          </tr> </tbody> 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -