When working with grids of data I sometimes find it useful to be able to set a class on a row based on the data (e.g. showing a list of entries where some are flagged as deleted, set a class on the row of “deleteditem” such that a strike-through style can be applied to those rows) or a class on a cell based on the data (e.g. a date column of due date where the date is overdue then set a class on the cell of “itemoverdue” such that the cell text becomes red).
It does seem easy to do the row thing with jqGrid – about the only way I can see is to hook in a custom formatter on the cell which then modifies parent row's class, which seems an unnecessary faff. To set a css class on the cell would require a similar thing, however since HTML can be specified as cell data that can be worked around by just putting a div or span with a class into the celldata which wraps the string to show.
Anyways, for setting a row class ideally the json data structure would allow each row to optionally define e.g.:
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top