how to keep css of selected rows in datatable while filtering

https://snippet.webix.com/0oc81sbp

I would like to keep the css of the selected rows while when filter is applied .

Thanks!

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

https://snippet.webix.com/idrk3mlv

the row CSS stays. Hope it makes sense.

Hi @alex257,

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:

https://snippet.webix.com/qpfyhlid

  1. instead of selection add/remove custom CSS when you click on an item:

https://snippet.webix.com/lwv9km7r

Thanks a lot, it worked for me