I would like to keep the css of the selected rows while when filter is applied .
I'm not an expert but I would say in your case the CSS is wiped out because when a filter is applied datatable seems to forget the selected rows which your CSS depends on. If you apply styles which don't depend on the selection like here for example
the row CSS stays. Hope it makes sense.
It's an expected behaviour that selection disappears after filtration, so there are two ways to solve your problem:
1) add onAfterFilter event and select rows again:
2) instead of selection add/remove custom CSS when you click on an item:
Thanks a lot, it worked for me
It looks like you're new here. If you want to get involved, click one of these buttons!