jqGrid : change cell color based on condition


loadComplete: function (data) {
ExecuteGetJSON();
ReceivedClientData(JSON.parse(getMain(data)).rows);
var ids = jQuery(“#table”).getDataIDs();
for (var i = 0, idCount = ids.length; i < idCount; i++) {
ids[i] = escape(ids[i]);
var rowData = jQuery(“#table”).jqGrid(‘getRowData’, ids[i]);
var point = rowData[‘Points’].toString();
var todayPoint = rowData[‘PrevPoints’].toString();
if (point != todayPoint) {
jQuery(“#table”).jqGrid(‘setCell’, ids[i], ‘Id’, ”, ‘ui-state-error ui-state-error-text’); }
else {
jQuery(“#table”).jqGrid(‘setCell’, ids[i], ‘Id’, ”, ”);
}
}
},

Advertisements

Leave a Reply

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