i m using a jqgrid on asp.net mvc… i have a specific requirement….The data in the grid is list of values that are to be set on each row… and each row has a Date column… While displaying the grid, i want a different row color on sunday and saturday.. while the rest of the rows are white.. How to achieve this in jquery jqgrid?
Share
You can “bring colors” in your grid with respect of setCell method of jqGrid (see this answer as an example) or
jQuery.addClass,jQuery.css(see this and this). You should do this after the grid contain is loaded, for example, inside of your loadComplete event handler.If you want set
background-colorstyle on the cell you should understand one small problem. The class'ui-widget-content'used for every grid row already defines thebackground-colorperbackgroundstyle (!!! not perbackground-color). So to have effects you should make changes of thebackground-colorstyle in one from the following ways: 1) just usebackground: yellowinstead ofbackground-color: yellow(see this). 2) remove ‘ui-widget-content’ class withjQuery.removeClass('ui-widget-content')(see this); 3) change style of the row more explicit like$("#"+rowid)[0].style.backgroundColor = "yellow"(see this as an example). Choose the ways which you prefer.