Row color on datatables


Topic: Row color on datatables

runnerhub pro premium priority asked 8 months ago

Expected behavior How to change color of full row on datatables, I con only change a cell color, not even the cell has access to full data.

Actual behavior I can only change a specific cell color

Resources (screenshots, code snippets etc.)


Grzegorz Bujański staff answered 8 months ago

If I understand correctly, you want to change the styles of the entire row if the cell value in that row has a specific value?


runnerhub pro premium priority commented 8 months ago

Yes, I can change one cell only, the function that is on documentation:

const formatCell = (cell, value) => {

so I have access just to the value of that specific cell, not the entire row data.


Grzegorz Bujański staff answered 8 months ago

Check out this snippet: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/6099897#js-tab-view I have prepared an example of how you can achieve this using the format option.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.2.0
  • Device: Mac
  • Browser: Chrome
  • OS: MacOs
  • Provided sample code: No
  • Provided link: No