Topic: Change row class based on column value datatables
Mateusz Lazaru staff answered 11 months ago
https://mdbootstrap.com/snippets/standard/mlazaru/5222865#js-tab-view
In this code, a function iterates over all the rows and add a class based on the first cell's value.
jmztaylor premium commented 11 months ago
After wrapping in .on('render.mdb.datatable') it worked perfectly. Loading data via fetch so had to wait till after. Thanks!
Mateusz Lazaru staff answered 11 months ago
Unfortunately, datatable does not have an option to pass classes to the rows. You would need to do that manually.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Premium
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: Pc
- Browser: Chrome
- OS: w11
- Provided sample code: No
- Provided link: Yes