<?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: Why Data in the Grid still Update? (afterSubmit Case)</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case</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/why-data-in-the-grid-still-update-aftersubmit-case/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tonier on Why Data in the Grid still Update? (afterSubmit Case)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10357</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10357</guid>
        	        	<description><![CDATA[<p><!--[if gte mso 9]><xml> Normal   0               false   false   false      EN-US   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--><!--  --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin-top:0cm; 	mso-para-margin-right:0cm; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> <!--[endif]--></mce:style></p>
<p>Thanks Tony, I have fixed my code.</p>
<p>Just figured out if I returned wrong value when I used JQuery "each" function. I returned array value for grid from the "each" function of JQuery instead "afterSubmit" function.</p>
<p>See the code below, maybe any users can learn what I have learnt.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2710' value='Select Code' data-codeid='sfcode2710' /></p>
<div class='sfcode' id='sfcode2710'>afterSubmit: function(r,d) { // check data returned from server<br />var dt = r.responseXML;<br />$(dt).find(&#39;res&#39;).each(function()<br />{ // result<br />&#160;&#160;&#160; if($(this).find(&#39;ok&#39;).text() == &#39;1&#39;)<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; eee = $(this).find(&#39;msg&#39;).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; alert(&#39;Data Updated!&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; return [true]; <span style="color: #ff0000;">// &#60;--- WRONG</span><br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; else<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; eee =$(this).find(&#39;msg&#39;).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; alert(&#39;Error:&#39;+eee);<br />&#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#useradm&#39;).trigger(&#39;reloadGrid&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; return [false]; <span style="color: #ff0000;">// &#60;--- WRONG</span><br />&#160;&#160;&#160; }<br />});<br />return true;<br />}</div>
<p>There is nothing wrong with your code.</p>
<p>Thanks for a great work Tony.</p>
]]></description>
        	        	<pubDate>Fri, 02 Oct 2009 20:22:48 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Why Data in the Grid still Update? (afterSubmit Case)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10347</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10347</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If (&#8230;) is not valid.</p>
<p>Try</p>
<p>if(&#8230;)</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 02 Oct 2009 10:42:56 +0300</pubDate>
        </item>
        <item>
        	<title>tonier on Why Data in the Grid still Update? (afterSubmit Case)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10271</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/why-data-in-the-grid-still-update-aftersubmit-case#p10271</guid>
        	        	<description><![CDATA[<p>It is work perfectly, until I get a case.</p>
<p>I used FormEdit to edit my data in the grid and submit a new Data. However, when the data posted and then something happen and my DB server sent error status, I want my data that already updated by user in the Form Editor does not copy into the Grid. In other words, I do not want my data in the grid also updated, if my server sent any errors because the data that posted previously.</p>
<p>I tried to return [false,&#8217;error message&#8217;] using afterSubmit function like:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8094' value='Select Code' data-codeid='sfcode8094' /></p>
<div class='sfcode' id='sfcode8094'>afterSubmit: function(r,d) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If(r.responseText == &#8216;error&#8217;)<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [false,&#8217;error error&#8217;];<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;&#160;&#160;&#160; return [true];<br />}</div>
</p>
<p>I thought if I return with<strong> [false]</strong> then the data in the grid will not be updated, but it is does not work like what I expected, data in my Grid still updated.</p>
<p>Currently I used <strong>trigger(&#8216;reloadGrid&#8217;)</strong> to meet my needs.</p>
</p>
<p>Any help would be appreciated ...</p>
</p>
<p>Regards,</p>
</p>
<p>Toni</p>
]]></description>
        	        	<pubDate>Tue, 29 Sep 2009 21:18:42 +0300</pubDate>
        </item>
</channel>
</rss>