<?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: Help to show messages from side server when validating</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating</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/help-to-show-messages-from-side-server-when-validating/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sebastiancb on Help to show messages from side server when validating</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24672</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24672</guid>
        	        	<description><![CDATA[<p>Thank you, it works perfectly</p>
]]></description>
        	        	<pubDate>Sun, 18 Sep 2011 09:47:17 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on Help to show messages from side server when validating</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24660</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24660</guid>
        	        	<description><![CDATA[<p>you can display server response messages from the edit, add, del jqgrid dialogs using one or more of the form edit events such as: afterSubmit.&#160; take a look at the <strong>events</strong> table on the docs link: <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....rm_editing</a> , You would need to create the function that gets fired after the dialog is submitted.&#160; Here is an example&#8230;</p>
</p>
<p>on the client side:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit979' value='Select Code' data-codeid='sfcode979' /></p>
<div class='sfcode' id='sfcode979'> &#160;&#160; &#160;// define handler function for &#39;afterSubmit&#39; event.<br /> &#160;&#160; &#160;var <strong>deleteMessage</strong> = function(response,postdata){<br /> &#160;&#160; &#160;&#160;&#160; &#160;var json&#160;&#160; = response.responseText; // response text is returned from server.<br /> &#160;&#160; &#160;&#160;&#160; &#160;var result = JSON.parse(json); // convert json object into javascript object.<br /> &#160;&#160; &#160;&#160;&#160; &#160;<br /> &#160;&#160; &#160;&#160;&#160; &#160;return [result.status,result.message,null]; <br /> &#160;&#160; &#160;}</div>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3086' value='Select Code' data-codeid='sfcode3086' /></p>
<div class='sfcode' id='sfcode3086'>&#160;&#160;&#160; $(&#39;#tab3-grid&#39;).jqGrid(&#39;navGrid&#39;, &#39;#tab3-pager&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;{view:true, closeOnEscape:true}, // general parameters.<br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // edit options.<br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // add options.<br />&#160;&#160; &#160;&#160;&#160; &#160;{<strong>afterSubmit: deleteMessage</strong>}, // del options.<br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // search options.<br />&#160;&#160; &#160;&#160;&#160; &#160;{}&#160; // view options.<br />&#160;&#160; &#160;);</div>
</p>
<p>On the server side:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2482' value='Select Code' data-codeid='sfcode2482' /></p>
<div class='sfcode' id='sfcode2482'>
<p>&#60;? php</p>
<p>&#160;&#160;&#160; $rows = mysql_affected_rows();</p>
<p>&#160;&#160;&#160; // if record deleted or not, send user a status message.<br />&#160;&#160;&#160; if($rows == 1) {<br />&#160;&#160; &#160;&#160;&#160;&#160; // send status message and response to jqgrid.<br />&#160;&#160; &#160;&#160;&#160;&#160; $message = &#39;Workorder record &#39;.$postConfig[&#39;rowID&#39;].&#39; deleted&#39;;<br />&#160;&#160; &#160;&#160;&#160;&#160; $output[&#39;status&#39;]&#160; = true; <br />&#160;&#160; &#160;&#160;&#160;&#160; $output[&#39;message&#39;] = $message;<br />&#160;&#160;&#160; }else{<br />&#160;&#160; &#160;&#160;&#160;&#160; // send status message and response to jqgrid.<br />&#160;&#160; &#160;&#160;&#160;&#160; $message = &#39;Workorder record &#39;.$postConfig[&#39;rowID&#39;].&#39; not deleted&#39;;<br />&#160;&#160; &#160;&#160;&#160;&#160; $output[&#39;status&#39;]&#160; = false; <br />&#160;&#160; &#160;&#160;&#160;&#160; $output[&#39;message&#39;] = $message;</p>
<p>&#160;&#160;&#160; }</p>
</p>
<p>&#160;&#160;&#160; // encode to json format and send output back to jqGrid table.<br />&#160;&#160; &#160;echo json_encode($output);</p>
<p>?&#62;</p>
</div>
]]></description>
        	        	<pubDate>Sat, 17 Sep 2011 00:00:31 +0300</pubDate>
        </item>
        <item>
        	<title>sebastiancb on Help to show messages from side server when validating</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24518</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-to-show-messages-from-side-server-when-validating#p24518</guid>
        	        	<description><![CDATA[<p>Hello, I am using jqgrid plugin and I want to show messages of validations that I specific in the editing script, for example this message "you don&#180;t have permission to execute this work", but I don&#180;t know how, I have been reading the documentation and I think that I have to use the event "aftersubmit", but I would like to get an example, the messages that I need to show have to appear after to press the button submit.</p>
<p>Here is an example of the file from server side which shows messages</p>
<p>&#60;?php</p>
<p>echo "This is the message to show after to press button submit";</p>
<p>?&#62;</p>
</p>
<p>In conclusion I need to show messages from server side when editing.</p>
]]></description>
        	        	<pubDate>Mon, 05 Sep 2011 08:07:46 +0300</pubDate>
        </item>
</channel>
</rss>