rowTemplate:
<ng-template # rowTemplate let-data>
<tr class="parenttr">
...
</tr>
</ng-template>
Click event:
ngOnInit(): void {
this.grid.element.addEventListener('click', function(e){
let element = e.target;
let row = parentsUntil((element as Element), 'parenttr');
if(!isNullOrUndefined(row)) {
let prevSelectedRows = gridInstance.getContent().querySelectorAll('.bgcolor');
for( let i = 0; i < prevSelectedRows.length; i++){
prevSelectedRows[i].classList.remove('bgcolor');
}
row.classList.add('bgcolor');
}
})
} |