<?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: ajax complete callback of form editing can interpret successful responds as errors</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors</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/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on ajax complete callback of form editing can interpret successful responds as errors</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors#p28650</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors#p28650</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Oleg. Thanks for this. I think that your fix is better. Going to success event will cause compatibilty problems.</p>
</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 15 Apr 2013 09:34:36 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on ajax complete callback of form editing can interpret successful responds as errors</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors#p28642</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/ajax-complete-callback-of-form-editing-can-interpret-successful-responds-as-errors#p28642</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>during testing jqGrid in Windows Azure Mobile Services I find that jqGrid interpret successful Delete operation as error. The reason is <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.5/js/grid.formedit.js#L1643" target="_blank">the line</a>&#160;inside of <strong>complete</strong> callback</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7426' value='Select Code' data-codeid='sfcode7426' /></p>
<div class='sfcode' id='sfcode7426'>if(status != &#34;success&#34;) {</div>
<p>It interprets all HTTP response from RESTfull services of Windows Azure Mobile Services as error because <strong>status</strong> is "nocontent". I used in my tests jQuery 1.9.1. The valus of <strong>data.status</strong> was 204 and <strong>data.status</strong> was&#160;"No Content" which full corresponds <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj710107.aspx" target="_blank">the documentation</a>&#160;(see description of "Status Code" in the "Response" part).</p>
<p>I think that the same problem one could have of Add new line, where successfully operation returns status code 201 (Created) instead of standard&#160;status code 200 (OK). See <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.5/js/grid.formedit.js#L714" target="_blank">the line</a> of editGridRow.</p>
<p>I suggest to change in both cases the test for success to</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3747' value='Select Code' data-codeid='sfcode3747' /></p>
<div class='sfcode' id='sfcode3747'>if (<strong>data.status &#62;= 300 &#38;&#38; data.status !== 304</strong>) {</div>
<p>or rewrite <span style="font-size: 14px;">the code of </span>Ajax to use <strong>success</strong> and <strong>error</strong> handler insted of <strong>complete</strong> handler.</p>
<p>By the way I find better to rename <strong>data</strong> variable inside of <strong>complete</strong>&#160;callback to <strong>jqXHR</strong> (the name which use jQuery now).</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Fri, 12 Apr 2013 20:27:20 +0300</pubDate>
        </item>
</channel>
</rss>