<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Custom fonts and colors for cells</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p14034</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p14034</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>@k2s</p>
<p>Thanks for the correction. It is the way that you write it.</p>
<p>It is my mistake.</p>
<p>Best regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 19 Jan 2010 11:30:45 +0200</pubDate>
        </item>
        <item>
        	<title>k2s on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13974</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13974</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
<p>Basically you are in the right direction.</p>
<p>In the optins parameter you have the id of the row. So it can be something like</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8145' value='Select Code' data-codeid='sfcode8145' /></p>
<div class='sfcode' id='sfcode8145'>
<p>function highlight (cellvalue, options, rowObject)</p>
<p>{</p>
<p>&#8230;</p>
<p>if(cellValueInt &#60; 600) $(&#8221;#&#8221;+options.rowId).addClass(&#8221;redclass&#8221;)</p>
<p>else $(&#8221;#&#8221;+options.rowId).addClass(&#8221;blueclass&#8221;)</p>
<p>&#8230;</p>
<p>return cellvalue</p>
<p>}</p>
</div>
<p>Regards</p>
<p>Tony</p>
</blockquote>
<hr />
<p>My experience is that this&#160;approach&#160;will not work, because the row is not inserted into DOM when formatter runs. So&#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5140' value='Select Code' data-codeid='sfcode5140' /></p>
<div class='sfcode' id='sfcode5140'>$(&#8221;#&#8221;+options.rowId)</div>
<p>is not valid.</p>
<p>I had to use afterInsert event, which is not a bad way:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6484' value='Select Code' data-codeid='sfcode6484' /></p>
<div class='sfcode' id='sfcode6484'>
<p>...</p>
<p>gridview:false,</p>
<p>altRow:false,</p>
<p>afterInsertRow:function (rowid,rowdata,rowelem){</p>
<p>&#160;&#160; &#160;if (rowdata._disabled&#62;0){</p>
<p>&#160;&#160; &#160; &#160; &#160;$("#"+rowid).addClass("disabledRow");</p>
<p>&#160;&#160; &#160;}</p>
<p>} &#160;&#160;</p>
</div>
<p>This will work until you don&#39;t have 2 instances of jqGrid at your page.</p>
<p><strong>What is the best selector to select row of jqGrid executing this function ?</strong> (something like $("#"+rowid, this))</p></p>
]]></description>
        	        	<pubDate>Sat, 16 Jan 2010 17:09:05 +0200</pubDate>
        </item>
        <item>
        	<title>hyperspace on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13713</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13713</guid>
        	        	<description><![CDATA[<p>gridComplete is what I was looking for. Thanks for pointing me in the right direction. 🙂</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 12:00:42 +0200</pubDate>
        </item>
        <item>
        	<title>karabot on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13711</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13711</guid>
        	        	<description><![CDATA[<p>Did you try any of the jqGrid events found at <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events?&#038;nbsp" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....&#038;nbsp</a>; Maybe the loadComplete or gridComplete events will work for you.&#160;&#160; I have never used them personally but look like they are good candidates.</p>
<p>George</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 10:28:52 +0200</pubDate>
        </item>
        <item>
        	<title>hyperspace on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13707</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13707</guid>
        	        	<description><![CDATA[<p>Howdy,</p>
<p>I changed:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5503' value='Select Code' data-codeid='sfcode5503' /></p>
<div class='sfcode' id='sfcode5503'>jQuery(this).find(&#39;colId&#39;).each(function(rowId){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var cellId = jQuery(this).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list4&#39;).jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color:&#39;red&#39;});<br />&#160;});</div>
<p>to...</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9752' value='Select Code' data-codeid='sfcode9752' /></p>
<div class='sfcode' id='sfcode9752'>jQuery(this).find(&#39;colId&#39;).each(function(){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var cellId = jQuery(this).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list4&#39;).jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color:&#39;red&#39;});<br />});</div>
</p>
<p>(Just removed the rowId) from that anonymous function(){} after .each.</p>
</p>
<p>Is there a way that I can put that entire ajax call in a function and call it after the load and reloadAfterSubmit:true ?</p>
<p>Im wanting it to do the ajax call after the user submits the form, and if they go to the next page in the grid etc...</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 02:52:44 +0200</pubDate>
        </item>
        <item>
        	<title>karabot on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13704</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13704</guid>
        	        	<description><![CDATA[<p>Hi Hyper,</p>
<p>I cannot see what has changed from the original post you made.</p>
<p>George</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 01:35:52 +0200</pubDate>
        </item>
        <item>
        	<title>hyperspace on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13703</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13703</guid>
        	        	<description><![CDATA[</p>
<p>Ok, I revised...</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2208' value='Select Code' data-codeid='sfcode2208' /></p>
<div class='sfcode' id='sfcode2208'>jQuery.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url: &#8220;&#60;?php echo $html-&#62;url(&#39;/ayp/getchanges&#39;); ?&#62;&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; cache: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; success: function(xml){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(xml).find(&#39;Change&#39;).each(function(){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var rowId = jQuery(this).attr(&#39;rowId&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(this).find(&#39;colId&#39;).each(function(){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var cellId = jQuery(this).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list4&#39;).jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color:&#39;red&#39;});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</div>
<p><input type='button' class='sfcodeselect' name='sfselectit1470' value='Select Code' data-codeid='sfcode1470' /></p>
<div class='sfcode' id='sfcode1470'>});</div>
<p>This works now, I thought if I had reloadAfterSubmit:true in my jqGrid that it would colorize on submit, but I was wrong.</p>
<p>How can I get it to call this after submit?</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 01:20:20 +0200</pubDate>
        </item>
        <item>
        	<title>hyperspace on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13702</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13702</guid>
        	        	<description><![CDATA[<p>Hi, im also trying to solve a similar problem, this is in an app im developing with CakePHP and jqGrid, btw Tony, jqGrid rocks!</p>
<p>I may be prematurely asking here, but from all the great responses that I see, I think you guys can help me out.</p>
<p>My grid is fine, working as intended, but I have a feature request to colorize the text in cells that have changed from the previous</p>
<p>version of a database table that the end user edits through the grid form.</p>
</p>
<p>I have this inside my jQuery(document).ready();, after my jqGrid stuff.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9621' value='Select Code' data-codeid='sfcode9621' /></p>
<div class='sfcode' id='sfcode9621'>jQuery.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url: "&#60;?php echo $html-&#62;url(&#39;/ayp/getchanges&#39;); ?&#62;",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; cache: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; success: function(xml){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(xml).find(&#39;Change&#39;).each(function(){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var rowId = jQuery(this).attr(&#39;rowId&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(this).find(&#39;colId&#39;).each(function(rowId){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var cellId = jQuery(this).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list4&#39;).jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color:&#39;red&#39;});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; });</div>
<p>The XML response that I am parsing looks like this...</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8478' value='Select Code' data-codeid='sfcode8478' /></p>
<div class='sfcode' id='sfcode8478'>&#60;Changes&#62;<br />&#160;&#160;&#160; &#60;Change rowId="7"&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;note&#60;/colId&#62;<br />&#160;&#160;&#160; &#60;/Change&#62;<br />&#160;&#160;&#160; &#60;Change rowId="10"&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;apscn_race&#60;/colId&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;note&#60;/colId&#62;<br />&#160;&#160;&#160; &#60;/Change&#62;<br />&#160;&#160;&#160; &#60;Change rowId="2704"&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;apscn_StudentName&#60;/colId&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;apscn_grade&#60;/colId&#62;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#60;colId&#62;apscn_race&#60;/colId&#62;<br />&#160;&#160;&#160; &#60;/Change&#62;<br />&#60;/Changes&#62;</div>
<p>The request fires and my response comes back to me, but I am not getting any sort of style change on my cells.</p>
<p>Am I hooking into the grid incorrectly? I began with this function defined in another file, and it didn&#39;t work there so I</p>
<p>moved it into the success: callback.</p>
<p>Please help! 🙂</p>
]]></description>
        	        	<pubDate>Sat, 09 Jan 2010 01:07:19 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13513</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13513</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>This call is wrong:</p>
<p>return cellvalue + $(&#8221;#&#8221;+options.rowId).addClass(&#8221;selected&#8221;, &#8220;highlight&#8221;);</p>
<p>should be:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5397' value='Select Code' data-codeid='sfcode5397' /></p>
<div class='sfcode' id='sfcode5397'>
<p>function highlight (cellvalue, options, rowObject)</p>
<p>{</p>
<p>$(&#8221;#&#8221;+options.rowId).addClass(&#8221;selected highlight&#8221;);</p>
<p>return cellvalue;</p>
<p>}</p>
</div>
<p>Note the addClass - where you mixed some things. See here: <a href="http://docs.jquery.com/Attributes/addClass#class" rel="nofollow" target="_blank"><a href="http://docs.jquery.com/Attribu" rel="nofollow">http://docs.jquery.com/Attribu</a>.....lass#class</a></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 03 Jan 2010 14:01:59 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13438</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13438</guid>
        	        	<description><![CDATA[<p>Thank you for the reply, I have been working on this all day today but everything I think of trying just doesn&#39;t seem to work.</p>
<p>Maybe you can clarify a few things for me.</p>
</p>
<p>&#60;head&#62;</p>
<p>&#60;style&#62;</p>
<p>.selected { color:red; }<br />.highlight { background:yellow; }</p>
<p>&#60;/style&#62;</p>
<p>&#60;/head&#62;</p>
</p>
<p>//This does not work it returns the cell value + [object Object]</p>
<p>&#8230;</p>
<p>function highlight (cellvalue, options, rowObject)</p>
<p>&#160;{</p>
<p>return cellvalue + $(&#8221;#&#8221;+options.rowId).addClass(&#8221;selected&#8221;, &#8220;highlight&#8221;);</p>
<p>}</p>
</p>
<p>//Nothing changes on my grid. I think it might be because of the return statement, I am not actually returning anything but original values.</p>
<p>function highlight (cellvalue, options, rowObject)</p>
<p>{</p>
<p>if(parseint(cellvalue) &#60; 600) $(&#8221;#&#8221;+options.rowId).addClass(&#8221;selected&#8221;, &#8220;highlight&#8221;);</p>
<p>else $(&#8221;#&#8221;+options.rowId).addClass(&#8221;selected&#8221;, &#8220;highlight&#8221;);</p>
<p>return cellvalue</p>
<p>}</p>
</p>
<p>Tony,</p>
<p>Thanks again for reading this!</p></p>
]]></description>
        	        	<pubDate>Wed, 30 Dec 2009 00:15:46 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13426</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13426</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Basically you are in the right direction.</p>
<p>In the optins parameter you have the id of the row. So it can be something like</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8513' value='Select Code' data-codeid='sfcode8513' /></p>
<div class='sfcode' id='sfcode8513'>
<p>function highlight (cellvalue, options, rowObject)</p>
<p>{</p>
<p>...</p>
<p>if(cellValueInt &#60; 600) $("#"+options.rowId).addClass("redclass")</p>
<p>else $("#"+options.rowId).addClass("blueclass")</p>
<p>...</p>
<p>return cellvalue</p>
<p>}</p>
</div>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 16:50:03 +0200</pubDate>
        </item>
        <item>
        	<title>newuser on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13406</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13406</guid>
        	        	<description><![CDATA[<p>Yeah I&#39;ve read quite a bit about it. I looked into it and what I need to do is provide a custom formatter for what I need, the only problem is that I am having a hard time putting it together. This is what I got so far. I will keep trying until I get it, even if it takes me a while.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7954' value='Select Code' data-codeid='sfcode7954' /></p>
<div class='sfcode' id='sfcode7954'>
<p>jQuery(document).ready(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function() {<br />jQuery("#s4list").jqGrid({</p>
<p>........</p>
<p>&#160; datatype: "json",</p>
<p>.....</p>
<p>colModel:[</p>
<p>{name:&#39;SKU Count&#39;,index:&#39;item_count&#39;, width:80,align:"right",searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}, formatter:highlight},</p>
<p>......</p>
<p>&#160;function highlight (cellvalue, options, rowObject)<br />&#160;{<br />&#160;&#160;varCellValueInt = parseInt(cellvalue); //How does it know that the cell I want to use is item_count ?<br />&#160;&#160;if (cellValueInt &#60; 600) //I want the item_count column to be checked if it finds a value &#60; 600 to highlight entire row.<br />&#160;&#160;&#160;return Json(new_formated_cellvalue); //Not sure what to put in the new formatted value to highlight the row a certain color.<br />&#160;&#160;else <br />&#160;&#160;&#160;return Json(cellvalue); //Not sure if this is correct, does it even need an else statement? I will need to test<br />&#160;}</p>
<p>....</p>
</div>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 04:44:36 +0200</pubDate>
        </item>
        <item>
        	<title>karabot on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13403</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13403</guid>
        	        	<description><![CDATA[<p>Alright I think you need to go back to the wiki and read the introductory material on jqGrid.&#160;&#160; All the response.* you see such as&#160; response.errorMessages are data specific for my application.&#160;</p>
<p>Maybe what you need to do is add a handler for a loadComplete event.&#160; In the body you can use the getRowData and setRowData to check for the value you are interested and to update the CSS for the rows you would like to highlight.</p>
<p>I am also fairly new to jQuery, jqGrid, etc. so maybe looking into the formatter Tony mentioned in his second post may worth your while.</p>
<p>Again I would suggest you look into the introductory material and understand how jqGrid works--I assure you this investment will re-pay you multiple times. 🙂</p>
<p>George.</p>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 00:46:40 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13400</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13400</guid>
        	        	<description><![CDATA[<p>Thank you very much for the update. What I&#39;d like to accomplish is check columnid &#39;item_count&#39; (which is defined&#160;in&#160;colModel and data is provided by server using php and a json response) to see if it has a value under 600, if it does I want to highlight the entire row with colors. I included the modified code using some of yours and I added comments on the things I didn&#39;t really understand maybe you can help me.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9199' value='Select Code' data-codeid='sfcode9199' /></p>
<div class='sfcode' id='sfcode9199'>
<p>jQuery(document).ready(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function() {<br />jQuery("#s4list").jqGrid({<br />&#160;scroll: 1,<br />&#160;&#160; &#160;<a href="&#39;jqgrid/search_adv.php?q=1&#39;" target="_blank">url:&#39;jqgrid/search_adv.php?q=1&#39;</a>,<br />&#160;datatype: "json",<br />&#160;width: 500,<br />&#160;&#160; &#160;colNames:[&#39;Store&#39;,&#39;Business Unit&#39;, &#39;SKU Count&#39;, &#39;Date&#39;],<br />&#160;&#160; &#160;colModel:[<br />&#160;&#160; &#160;&#160;{name:&#39;Store&#39;,index:&#39;store_number&#39;, width:65, searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;&#160;{name:&#39;Businness Unit&#39;,index:&#39;bu&#39;, width:80, align:"right",searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160;{name:&#39;SKU Count&#39;,index:&#39;item_count&#39;, width:80,align:"right",searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;&#160;{name:&#39;Date&#39;,index:&#39;datetime&#39;, width:90, align:"right",searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;],<br />&#160;&#160; &#160;rowNum:30,<br />&#160;&#160; &#160;mtype: "POST",<br />&#160;&#160; &#160;rowList:[30,40,60],<br />&#160;&#160; &#160;pager: &#39;#s4pager&#39;,<br />&#160;&#160; &#160;sortname: &#39;item_count&#39;,<br />&#160;&#160;&#160; viewrecords: false,<br />&#160;rownumbers: true,<br />&#160;gridview : true,<br />&#160;&#160;&#160; sortorder: "asc",<br />&#160;&#160;&#160; caption:"SKU Count of stores databases"<br />});</p>
<p>jQuery("#s4list").jqGrid(&#39;navGrid&#39;,&#39;#s4pager&#39;,<br />{<br />&#160;edit:false,add:false,del:false,search:true,refresh:true<br />},<br />{}, // edit options<br />{}, // add options<br />{}, //del options<br />{multipleSearch:true} // search options<br />);</p>
<p>jQuery("#s4list").jqGrid(&#39;gridResize&#39;,{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});</p>
<p>for (var i = 0; i &#60;= response.data.rows.length; i++) {&#160; //Increments<br />jQuery("#s4list").jqGrid(&#39;addRowData&#39;,i + 1, response.data.rows[i]); //Goes through each row setting color<br />}<br />for(var i=0;i&#60;response.errorMessages.length;i++) {&#160; //Checks the Length of errorMessages but what is stored inside ErrorMessages?<br />var rowId=response.errorMessages[i].record; //$responce-&#62;rows[$i][&#39;id&#39;]=$row[record];&#160; I do not use this in my colModel but this is an AutoIncrementing field in my DB. Set it to record per your suggestion<br />var cellId=response.errorMessages[i].item_count; //Per your suggestion I changed cellId with the cellId that I&#39;d like to perform the check on and it&#39;s item_count defined in colModel<br />jQuery("#s4list").jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color: &#39;yellow&#39;,background: &#39;red&#39;}); //This is obvious sets the color on the entire cell if the cellId equals condition<br />}</p>
<p>});</p>
</div>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 00:24:50 +0200</pubDate>
        </item>
        <item>
        	<title>karabot on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13397</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13397</guid>
        	        	<description><![CDATA[<p>I used the setCell() functionality that Tony mentioned on his original response (BTW, thank you Tony!).</p>
</p>
<p>I obtain the data on the server side throught a separate JSON request and I check for malformed cells in there.&#160; I am pretty sure you can do it if you are obtaining the data directly through the jqGrid.&#160; I then have a return data structure which is an array containing entries of the form: {message: "my message", rowId: row, cellId: cell}.&#160; Remember rowId is what you have set your ID to be or if you have not set anything its an iuncremental number.&#160; Cell Id is also what you have specified as name is the colModel.</p>
<p>I first set the grid in JavaScript and then iterate through the forementioned data structure to highlight the malformed entries.&#160; Here&#39;s the code:</p>
<p>...<br /> // Create the preview grid<br /> jQuery("#gridErrorPreviewTable").jqGrid({<br /> datatype: "local",<br /> height: "100%", <br /> colNames: response.data.colNames, <br /> colModel: response.data.colModel, <br /> pager: &#39;#pagerErrorGridPrevieTable&#39;,<br /> viewrecords: true, <br /> caption: &#39;Import File Preview&#39;<br /> });<br /> // set the pager<br /> jQuery(&#39;#gridErrorPreviewTable&#39;).jqGrid(&#39;navGrid&#39;,&#39;#pagerErrorGridPreviewDiv&#39;, {edit:false,add:false,del:false,search:true});</p>
<p>// add the data<br /> for (var i = 0; i &#60;= response.data.rows.length; i++) { <br /> jQuery("#gridErrorPreviewTable").jqGrid(&#39;addRowData&#39;,i + 1, response.data.rows[i]);<br /> }</p>
<p> for(var i=0;i&#60;response.errorMessages.length;i++) {<br /> var rowId=response.errorMessages[i].rowId;<br /> var cellId=response.errorMessages[i].cellId;<br /> jQuery("#gridErrorPreviewTable").jqGrid(&#39;setCell&#39;,rowId,cellId,&#39;&#39;,{color: &#39;yellow&#39;,background: &#39;red&#39;});<br /> }<br />...</p>
</p>
<p>I hope it helps you newperson 🙂</p>
<p>George</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 23:26:03 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13381</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13381</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Another possible and very easy solution is to use a custom formatter.</p>
<p>There is example for this here:</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter#example" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....er#example</a></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 18:29:21 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13376</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13376</guid>
        	        	<description><![CDATA[<p>karabot,</p>
<p>if you figure it out it&#39;d be cool if you could follow up here, what you want to do is a cool idea and I could definetely use it on my grid. I looked at the link tony provided but god damn it&#39;s way over my head.</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 18:00:23 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13340</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13340</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Look at docs - see setCell method</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....ki:methods</a></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 26 Dec 2009 13:06:05 +0200</pubDate>
        </item>
        <item>
        	<title>karabot on Custom fonts and colors for cells</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13299</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-fonts-and-colors-for-cells#p13299</guid>
        	        	<description><![CDATA[<p>Hello all,</p>
<p>I have a requirement in one of my projects where I have to highlight malformed entries on a table. &#160;So I am wondering whether there is a way to customize the look and feel of individual cells in a grid? &#160;Setting the value with a &#60;font...&#62;...&#60;/font&#62; HTML tag does not seem to work for me.</p>
<p>TIA,</p>
<p>George</p>
]]></description>
        	        	<pubDate>Thu, 24 Dec 2009 22:55:15 +0200</pubDate>
        </item>
</channel>
</rss>