<?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: Problem using cellattr function to obtain row data values</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-using-cellattr-function-to-obtain-row-data-values</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/problem-using-cellattr-function-to-obtain-row-data-values/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Problem using cellattr function to obtain row data values</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-using-cellattr-function-to-obtain-row-data-values#p26433</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-using-cellattr-function-to-obtain-row-data-values#p26433</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Did you have read the docs?</p>
<p>It state: <em>rawObject</em> &#8211; the raw object of the data row &#8211; i.e if datatype is json &#8211; array, if datatype is xml xml node.</p>
<p>With other words in your case it is a xml node.</p>
</p>
<p>You can get the value of the node using the function: $.jgrid.getXmlData.</p>
<p>In your case this can be like this - get the <strong>po</strong>&#160; data:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9924' value='Select Code' data-codeid='sfcode9924' /></p>
<div class='sfcode' id='sfcode9924'>
<p>&#160; &#160; &#160; cellattr: function(rowId, tv, rawObject, cm, rdata) {<br /> &#160; &#160; &#160; &#160; &#160; &#160; return &#39; style=&#34;color:black;background:&#39; + $.jgrid.getXmlData( rawObject, &#34;po&#34; ) +  &#39;;&#34;&#39;;<br /> &#160; &#160; &#160; }},</p>
</p>
</div>
<p>Also if you want to get the project you can do</p>
<p>$.jgrid.getXmlData( rawObject, "project");</p>
<p>The same way for others.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Sat, 21 Apr 2012 09:53:24 +0300</pubDate>
        </item>
        <item>
        	<title>cseelig on Problem using cellattr function to obtain row data values</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-using-cellattr-function-to-obtain-row-data-values#p26429</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-using-cellattr-function-to-obtain-row-data-values#p26429</guid>
        	        	<description><![CDATA[<p>I have not been able to figure out how to get a value from rawObject.<br /> In particular, I need to examine other cols for the current cell (same row)<br /> While tv holds the current cell value, can I examine other cells in the same row?</p>
<p><strong>Note: rawObject.po is undefined inside the function.</strong></p>
<p> Thank you!</p>
<p>
$("#projects").jqGrid({<br /> &#160; url:&#39;custom.pl&#39;,<br /> &#160; postData:{&#39;func&#39;:&#39;projects&#39;},<br /> &#160; datatype: &#39;xml&#39;,<br /> &#160; mtype: &#39;GET&#39;,<br /> &#160; colNames:[&#39;po&#39;,&#39;Project&#39;, &#39;Contact&#39;, &#39;Email&#39;, &#39;Opened&#39;, &#39;Next Step&#39;],<br /> &#160; colModel :[<br /> &#160; {name:&#39;po&#39;,		width:100, align:&#39;left&#39;, sortable:false, xmlmap:"po"},<br /> &#160; {name:&#39;project&#39;,	width:400, align:&#39;left&#39;, sortable:false, xmlmap:"name"},<br /> &#160; {name:&#39;contact&#39;,	width:160, align:&#39;left&#39;, sortable:false, xmlmap:"contact"},<br /> &#160; {name:&#39;email&#39;,		width:160, align:&#39;left&#39;, sortable:false, xmlmap:"email"},<br /> &#160; {name:&#39;opened&#39;,		width:100, align:&#39;left&#39;, sortable:false, xmlmap:"create"},<br /> &#160; {name:&#39;step&#39;,		width:160, align:&#39;left&#39;, sortable:false, xmlmap:"step",<br /> &#160; &#160; &#160;<strong> cellattr: function(rowId, tv, rawObject, cm, rdata) {<br /> &#160; &#160; &#160; &#160; &#160; &#160; return &#39; style="color:black;background:&#39; + status_color_map[tv] +  &#39;;"&#39;;<br /> &#160; &#160; &#160; }},</strong><br /> &#160; ],<br /> &#160; <strong>xmlReader</strong>: { <br />&#160; &#160; root:"projects", <br />&#160; &#160; row:"project",<br />&#160; &#160; page:"rows&#62;currentpage",<br />&#160; &#160; total:"rows&#62;totalpages",<br />&#160; &#160; records:"rows&#62;totalrecords",<br />&#160; &#160; repeatitems:false,<br />&#160; &#160; id : "pid"<br /> &#160; },<br /> &#160; rowNum:200,<br /> &#160; sortname: &#39;id&#39;,<br /> &#160; sortorder: &#39;desc&#39;,<br /> &#160; &#8230;</p>
]]></description>
        	        	<pubDate>Fri, 20 Apr 2012 21:39:35 +0300</pubDate>
        </item>
</channel>
</rss>