jquery ui - How to change the color of jqGrid cell? -


i use following line @ $(document).ready(

$("#stsearchtermsgrid").setcell(2, 2, '', {color:'red'}) ; 

but doesn't work. did write in wrong way or placed in wrong place.

i know question has been asked more once before , how got first line. still not able , not knowing problem is.

you right not first person ask question. clear situation cell color made the demo

enter image description here

for change text color of cell or background color of sell in different ways:

loadcomplete: function() {     // 2 zero-base index of column 'name' ('client'). every options     // multiselect:true, rownumbers:true , subgrid:true increase     // index 1 because option inserts additional columns     $("#6 td:eq(2)", grid[0]).css({color:'red'});      grid.jqgrid('setcell',"12","name","",{color:'red'});     grid.jqgrid('setcell',"10",'name', '', 'my-highlight');     grid.jqgrid('setcell',"8",'name', '', 'ui-state-error ui-state-error-text');      grid.jqgrid('setcell',"4","name","",{'background-color':'yellow',                                          'background-image':'none'});     grid.jqgrid('setcell',"3","name","",'ui-state-highlight'); } 

where

<style type="text/css">     .my-highlight { color: red; } </style> 

and "3", "4", "6", "8", "10" , "12" th rowid of rows color of corresponding column changed.

by way personal favorites ways using 'ui-state-highlight' or 'ui-state-error ui-state-error-text' classes part of jquery ui themes.

updated: understand difference of usage of different methods in case of usage of jquery ui theme added one more demo used la frog theme same table above following:

enter image description here


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -