Topic: Change row class based on column value datatables
mlazaru staff answered 2 years 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 pro premium commented 2 years ago
After wrapping in .on('render.mdb.datatable') it worked perfectly. Loading data via fetch so had to wait till after. Thanks!
mlazaru staff answered 2 years 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
- User: Pro
- 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