Conditional row coloring
Highlight any number of rows based on the value in a column. Preserve coloring across sorting.
- Currently the row element is not provided to the cell formatter, and is not easily available until after the table is fully rendered.
- Due to CSS restrictions in IE, cross browser row striping is not possible for consecutive colored rows (e.g. using a slightly darker shade of the color for the odd rows).
- DataTable reuses existing
tr elements when sorting, so the coloring class needs to be removed from the rows before and reapplied after sorting.
Use a custom formatter to cache the records that will need to have their corresponding rows colored, then apply the row coloring in a renderEvent handler.