<?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: onComplete Handler Hook over all Ajax Calls from jqGrid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid</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/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on onComplete Handler Hook over all Ajax Calls from jqGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid#p22688</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid#p22688</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I find your question interesting. Some versions ago it was introduced the <strong>serializeGridData</strong>&#160;event which allows to preprocess the data <em>before</em> the ajax call. Introducing of another function like <strong>preprocessServerResponse</strong>&#160;which will be inserted at <a href="https://github.com/tonytomov/jqGrid/blob/master/js/grid.base.js#L1657" target="_blank">the begining of the success handle</a> could solve your problem.</p>
<p>To implement your requirement inthe current version of jqGrid you can use <strong>dataFilter</strong> parameter of <a href="http://api.jquery.com/jQuery.ajax/" target="_blank">jQuery.ajax</a> which can be set with respect of <strong>ajaxGridOptions</strong> parameter.&#160;It allows you to do postprocessing of the results. The look at <a href="https://github.com/jquery/jquery/blob/1.4.4/src/ajax.js#L672" target="_blank">here</a>&#160;and <a href="https://github.com/jquery/jquery/blob/1.5.2/src/ajax.js#L900" target="_blank">here</a> can clear everithing.</p>
<p>Best regards<br />Oleg</p></p>
]]></description>
        	        	<pubDate>Wed, 06 Apr 2011 19:15:01 +0300</pubDate>
        </item>
        <item>
        	<title>sonarok on onComplete Handler Hook over all Ajax Calls from jqGrid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid#p22682</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/oncomplete-handler-hook-over-all-ajax-calls-from-jqgrid#p22682</guid>
        	        	<description><![CDATA[<p>hi guys,</p>
</p>
<p>after trying around 2 days without a good solution i could need your help 🙂</p>
</p>
<p>first of all what we want to do is a whole hook / wrapper for all jqgrid ajax calls.</p>
<p>the target is that our server can always answer with a json response looking like this:</p>
</p>
<p>ack: success / fail</p>
<p>timestamp: 1111111111111111</p>
<p>error: errorObj{errorCode:123, errorMsg:abc}</p>
<p>jqgrid_payload: {the realdata for our jqgrid , also jqgrid json error data, etc.}</p>
<p>action: actionObj{}</p>
</p>
<p>our hook code would parse this, take care of all additional data and forward only the payload data to our jqgrids.</p>
<p>this solution is needed as a central point of application control.</p>
</p>
<p>for example if a user session expires we want to redirect the user to the login screen. this could be done by a special errorCode.</p>
<p>if the user change some data we want to be able to switch off the editing on special fields (controlled by the server).</p>
<p>also we need to trigger other UI Componets depending on changes that the jqGrid send to the server and the server decide what should happen.</p>
<p>i started to play around with datatype: function ().... and this gets near a solution but like i saw this is only triggern on reload/fetch calls, for validation or editing other ajax calls are used...</p>
<p>all onComplete events dont work because they are triggered additionaly to the normal ajax flow.</p>
<p>really dont remember all my trys but i had alot 🙁</p>
<p>also it would be a solution for us if we get a list of hook points where we could write our own ajax calls, always use the central responseParsing function and forward the payload data to our jqgrid...</p>
<p>hope someone has a solution for this. thx!</p></p>
]]></description>
        	        	<pubDate>Wed, 06 Apr 2011 14:35:17 +0300</pubDate>
        </item>
</channel>
</rss>