swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

All rows are active after selecting row programmatically (table with groupping) #2018

Open deamodis opened 3 years ago

deamodis commented 3 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

All rows are active instead of one specific (when specific row is selected programmatically).

Expected behavior

Only selected row is active.

Reproduction of the problem I chose row programmatically in AfterViewInit lifehook (that's just my test solution). Instead of activating one row, all rows are active (there is class active for every datatable-body-row DOM element).

Example: https://stackblitz.com/edit/angular-ngx-datatable-row-grouping-and-row-detail-7q3fwc?file=src/app/app.component.ts

What is the motivation / use case for changing the behavior? I want to add styling class for selected row. When I select row datatable-body-row is set with class active . So I can use this class to stylish selected row. But now it's not possible because all datatable-body-row are set with class active.

macOS Big Sur (11.0.1), WebStorm, npm.

klammal commented 2 years ago

I'm facing this issue as well with the latest version of ngx-datatable and angular.

is there any plans to fix it?

zengchuan commented 2 years ago

I'm facing this issue. ngx-datatable: 20.0.0 angular: 13.3.0