Changing font color of a column in jqGrid.

Hi,

We had a requirement to change the font color of a particular column in jqGrid. We achieved it in the following manner.

Using the formatter property


The fontColorFormat function


function fontColorFormat(cellvalue, options, rowObject) {
 var color = "blue";
 var cellHtml = "<span style='color:" + color + "' originalValue='" + cellvalue + "'>" + cellvalue + "</span>";
 return cellHtml;
 }

Hope it helps!


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s