<?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: Cell Edit - How to Return Server Error</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error</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/cell-edit-how-to-return-server-error/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>djp on Cell Edit - How to Return Server Error</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10315</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10315</guid>
        	        	<description><![CDATA[<p>Thanks seantsm28, thats exactly the pointer I needed! All working now.</p>
</p>
<p>I was working in the right area, with afterSubmitCell event, but couldn&#39;t work out how to catch the response correctly.</p>
</p>
<p>It would help if the examples showed something like this.</p>
</p>
<p>Thanks again, dj</p>
]]></description>
        	        	<pubDate>Fri, 02 Oct 2009 04:03:28 +0300</pubDate>
        </item>
        <item>
        	<title>seantsm28 on Cell Edit - How to Return Server Error</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10305</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10305</guid>
        	        	<description><![CDATA[<p>Here is how I take care of this.</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; afterSubmitCell: function (serverresponse, rowid, cellname, value, iRow, iCol) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var mymess = serverresponse.responseText;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var retbool = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;if (mymess != &#39;1&#39;) { retbool = false; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var myret = [retbool,mymess];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; return myret;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
</p>
<p>I make sure that my server update routines return a &#39;1&#39; if all goes well, otherwise they return an error message that explains what the problem is.&#160; Then the grid will put up a dialog error with the returned message and nothing is changed in the cell.</p></p>
]]></description>
        	        	<pubDate>Thu, 01 Oct 2009 11:07:28 +0300</pubDate>
        </item>
        <item>
        	<title>djp on Cell Edit - How to Return Server Error</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10304</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cell-edit-how-to-return-server-error#p10304</guid>
        	        	<description><![CDATA[<p>I am new to jqgrid and I&#39;m trying to get cell editing against a remote server working.</p>
</p>
<p>To me, it is not clear from the documentation or examples what the server should return in response to cell edit ajax requests. I can submit and perform a database update okay, but if there is a database error, what ever I return from the server, the grid updates. The only way I have found to display an error is to set the HTTP response code to 400 or 500 range, but can return no useful error message.</p>
</p>
<p>How do I return a meaningful server error and display it?</p>
<p>Using php &#38; JSON the best I can work out from the documentation is something like this, is this correct?</p>
</p>
<p>&#160;echo json_encode(array(false, &#39;Update Failed&#39;));</p>
</p>
<p>If so, how do I catch and display the error and prevent the grid from updating? Otherwise, what am I doing wrong.</p>
</p>
<p>Thanks, dj</p>
]]></description>
        	        	<pubDate>Thu, 01 Oct 2009 10:10:44 +0300</pubDate>
        </item>
</channel>
</rss>