how to set jqgrid cell color at runtime

Posted by anil on Stack Overflow See other posts from Stack Overflow or by anil
Published on 2010-05-28T05:05:23Z Indexed on 2010/05/28 5:11 UTC
Read the original article Hit count: 720

Filed under:

Hi,

i am populating a jqgrid from database and one of its columns is a color column like red, blue, etc. Can i set the cell color of this column based on the value coming from database at run time? how should i set formatter in this case? i tried like this but do not work

var colorFormatter = function(cellvalue, options, rowObject) { var colorElementString = '';

return colorElementString;


colModel: [ { name: 'GroupName', index: 'GroupName', width: 200, align: 'left' }, { name: 'Description', index: 'Description', width: 300, align: 'left' }, { name: 'Color', index: 'Color', width: 60, align: 'left', formatter: colorFormatter}],

© Stack Overflow or respective owner

Related posts about jqgrid-asp.net