Dynamic tables - access to row classes or styles
Dynamic tables - access to row classes or styles
CrashMeister
Posts: 8Questions: 0Answers: 0
I have a dynamic table that changes based on user activity. I use fnClearTable(), then fnAddData() and finally fnDraw(true) to redraw the table.
The table has rows that are only added if the user has checked a checkbox on the parent row. These child rows need to have different backgrounds to the parent (always visible) rows.
How can I change the background while generating the table ?
Thanks,
Craig.
The table has rows that are only added if the user has checked a checkbox on the parent row. These child rows need to have different backgrounds to the parent (always visible) rows.
How can I change the background while generating the table ?
Thanks,
Craig.
This discussion has been closed.
Replies
Thanks,
Craig.
You can provide a class name for any column ("sClass" property) or apply a class to cells, rows or other DOM elements on-the-fly based on their content using various callbacks (fnRowCallback, fnDrawCallback, to some degree also with fnRender (for content WITHIN a cell, but not the cell itself))
to change row css based on checkmark, iterate through your TABLE rows (or use fnRowCallback), look for that TD, get the value of the checkbox, then apply a CSS class to the TR.