ydn-js origin

YUI version 2.5.1

Conditional cell highlighting

Challenge

Add support for custom cell formatting. Highlighting should be maintained across column sorting. Row striping should be respected. Support "unmarking" highlight.

Solution

Subscribe to the DataTable's renderEvent. The subscribed function captures values of input fields and iterates through the table's tbody rows, comparing the input value against the DataTable's RecordSet value for that cell. Class mark is assigned to the cell if the Record data satisfies a > conditional. Otherwise, class ok is assigned.

Highlighting and row striping is maintained via css.