<?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: jqgrid php: how to report an error in dialog</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-php-how-to-report-an-error-in-dialog</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/discussion/jqgrid-php-how-to-report-an-error-in-dialog/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>kobruleht on jqgrid php: how to report an error in dialog</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-php-how-to-report-an-error-in-dialog#p23202</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-php-how-to-report-an-error-in-dialog#p23202</guid>
        	        	<description><![CDATA[<p>You shoult set http response code to 4xx</p>
<p>In this case jqGrid reports error.</p>
]]></description>
        	        	<pubDate>Mon, 16 May 2011 12:20:54 +0300</pubDate>
        </item>
        <item>
        	<title>galli2000 on jqgrid php: how to report an error in dialog</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-php-how-to-report-an-error-in-dialog#p22966</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-php-how-to-report-an-error-in-dialog#p22966</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I&#39;m currently using the jqGrid php implementation with a manual transaction for adding a record in the grid.</p>
<p>E.g.:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6428' value='Select Code' data-codeid='sfcode6428' /></p>
<div class='sfcode' id='sfcode6428'>
<p>$oper = jqGridUtils::GetParam(&#39;oper&#39;);<br />if ($oper == &#39;add&#39;) {</p>
<p>&#160;&#160;&#160; $grid-&#62;trans = false;&#160;&#160;&#160;&#160;&#160;&#160; // disable the transaction<br />&#160;&#160;&#160; try {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::beginTransaction($conn);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $reference = jqGridUtils::GetParam(&#39;reference&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $name = jqGridUtils::GetParam(&#39;name&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $brand = jqGridUtils::GetParam(&#39;brand&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $price = jqGridUtils::GetParam(&#39;price&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_quantity_left = jqGridUtils::GetParam(&#39;total_quantity_left&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $product = jqGridDB::prepare($conn,<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;&#160;&#160;&#160;&#160;&#160; &#34;INSERT INTO product (id, reference, name, brand, price, total_quantity_left) VALUES (NULL,?,?,?,?,?)&#34;,<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;&#160;&#160;&#160;&#160;&#160; array($reference,<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $name,<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $brand,<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $price,<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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_quantity_left,<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;&#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;&#160;&#160;&#160;&#160;&#160; );<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $stock1 = jqGridDB::prepare($conn,<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;&#160;&#160;&#160;&#160; &#34;INSERT INTO stock (id, shop_id, product_id, quantity) SELECT NULL, 1, (SELECT MAX(id) FROM product), ?&#34;,<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;&#160;&#160;&#160;&#160; array(jqGridUtils::GetParam(&#39;quantity_shop1&#39;))<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;&#160;&#160;&#160;&#160; );<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $stock2 = jqGridDB::prepare($conn,<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;&#160;&#160;&#160;&#160; &#34;INSERT INTO stock (id, shop_id, product_id, quantity) SELECT NULL, 2, (SELECT MAX(id) FROM product), ?&#34;,<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;&#160;&#160;&#160;&#160; array(jqGridUtils::GetParam(&#39;quantity_shop2&#39;))<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;&#160;&#160;&#160;&#160; );</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::execute($product);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::execute($stock1);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::execute($stock2);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::commit($conn);</p>
<p>&#160;&#160;&#160; } catch(Exception $e) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridDB::rollBack($conn);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo $e-&#62;getMessage();<br />&#160;&#160;&#160; }</p>
<p>}</p>
</p>
</div>
<p>This works fine so far.</p>
<p>The problem that I have now is that I want to inform the user if an error occurred during the transaction: typically I&#39;d like to popup a error dialog showing the $e-&#62;getMessage(), or the cause of the error</p>
<p>Since the error is detected at the php level, how do I invoke a javascript code portion to achieve this (alert(...) or $.jqgrid.info_dialog(...) I guess)?</p>
</p>
<p>Thanks,</p>
<p>jerome</p></p>
]]></description>
        	        	<pubDate>Thu, 28 Apr 2011 17:37:05 +0300</pubDate>
        </item>
</channel>
</rss>