I have a sample colModel which has all the marks of the students. And If the students mark is less than 50,I want to displaay the cell in RED colour and above 50 as green colour. Another scenario where The cell colour depends on the other column value. Is it possible to achieve these cutom options in jqgrid. Thanks in advance.
How to change the cell colour based on the value of the cell in jqgrid
901 views Asked by user2375298 At
1
I seems to me you need just use
cellattr
callback in the corresponding column. See the answer and this one (or this one if you usedatatype: "xml"
) for the code example. Inside ofcellattr
callback to the value of the current column, rowid and to the values from all other columns to the row too. So you can set dynamic value ofclass
attribute for the cells of the column of set dynamic (different) values ofstyle
attribute.