<?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: accessing rowdata after row save...</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/accessing-rowdata-after-row-save</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/accessing-rowdata-after-row-save/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>erwindeclerck on accessing rowdata after row save...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/accessing-rowdata-after-row-save#p20675</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/accessing-rowdata-after-row-save#p20675</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I use gridComplete to change the color of my line according to a column value.</p>
<p>This works fine, but I would like to do the same after a line edit...</p>
<p>When I use jqGrid(&#39;saveRow&#39;,lastsel,"","","",myfunction); then I get the html code in stead of the row data...&#160;</p>
<pre class="code javascript">(see: jqGrid(&#39;saveRow&#39;,rowid, succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc);)</pre>
<pre class="code javascript"></pre>
<p>This is normal according tot getRowData documentation: (Do not use this method when you editing the row or cell. This will return the cell content and not the actuall value of the input element&#160;)&#160;</p>
<p>But how can I access the data immediately after a rowedit save?</p>
<p>Code that works:</p>
<p>gridComplete: function(){</p>
<p>var ids = jQuery("#"+subgrid_table_id).jqGrid(&#39;getDataIDs&#39;);</p>
<p>for(var i=0;i &#60; ids.length;i++){</p>
<p style="padding-left: 30px; ">var thisstatus=jQuery(&#39;#&#39;+subgrid_table_id).jqGrid(&#39;getRowData&#39;,ids[i]);</p>
<p style="padding-left: 30px; ">switch (thisstatus[&#39;status&#39;]) {</p>
<p style="padding-left: 30px; ">case &#39;KlaarExtra&#39;: 								jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;green&#39;); 							break;</p>
<p style="padding-left: 30px; ">case &#39;Klaar&#39;: 								jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;green&#39;); 							break;</p>
<p style="padding-left: 30px; ">case &#39;Onbetaald&#39;: 								jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;red&#39;); 							break;</p>
<p style="padding-left: 30px; ">case &#39;Opvolgen&#39;: 								jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;brown&#39;); 							break;</p>
<p style="padding-left: 30px; ">case &#39;Begraven&#39;: 								jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;silver&#39;); 							break;</p>
<p>} 					}  				},</p>
<p>...</p>
<p>code that doesn&#39;t</p>
<p>function myfunction(lastsel,tableid){</p>
<p>//	alert("gothere"+rownumber);</p>
<p>var thisstatus=jQuery(&#39;#&#39;+tableid).getRowData(lastsel);&#160;</p>
<p>switch (thisstatus[&#39;status&#39;]) {</p>
<p>case &#39;KlaarExtra&#39;:				jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;green&#39;);			break;</p>
<p>case &#39;Klaar&#39;:				jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;green&#39;);			break;</p>
<p>case &#39;Onbetaald&#39;:				jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;red&#39;);			break;</p>
<p>case &#39;Opvolgen&#39;:				jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;brown&#39;);			break;</p>
<p>case &#39;Begraven&#39;:				jQuery(&#39;#&#39;+ cl).css(&#39;color&#39;,&#39;silver&#39;);			break;</p>
<p>}	return &#160;true;</p>
<p>}</p>
<p>Kind regards</p>
<p>Erwin</p>
<p>PS: jqgrid rocks!</p>
]]></description>
        	        	<pubDate>Fri, 05 Nov 2010 01:12:46 +0200</pubDate>
        </item>
</channel>
</rss>