<?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:  instead of just the grid,  trigger("reloadGrid") refreshes the main page</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page</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/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>KKP on  instead of just the grid,  trigger("reloadGrid") refreshes the main page</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page#p30468</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page#p30468</guid>
        	        	<description><![CDATA[<p>Haha found the solution myself:<img class="spSmiley" style="margin:0" class="sfsmiley" title="Laugh" src="http://www.trirand.com/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /><img class="spSmiley" style="margin:0" class="sfsmiley" title="Cool" src="http://www.trirand.com/blog/wp-content/forum-smileys/sf-cool.gif" alt="Cool" /></p>
<p>$("#customerSearchForm").submit(function (e) {</p>
<p>e.preventDefault();</p>
<p>$(&#39;#customerResults&#39;).jqGrid().setGridParam({</p>
<p><span style="white-space: pre;"> </span>url: $(&#39;form:first&#39;).attr(&#39;action&#39;),</p>
<p><span style="white-space: pre;"> </span>postData: $(&#39;form:first&#39;).serialize(),</p>
<p><span style="white-space: pre;"> </span>datatype:&#39;json&#39;,</p>
<p><span style="white-space: pre;"> </span>jsonReader : { 								root: "rows", 								page: "page", 						        total: "total", 						  }</p>
<p><span style="white-space: pre;"> </span>}).trigger("reloadGrid", [{page:1} ]);</p>
<p>});</p>
]]></description>
        	        	<pubDate>Mon, 07 Apr 2014 23:49:34 +0300</pubDate>
        </item>
        <item>
        	<title>KKP on  instead of just the grid,  trigger("reloadGrid") refreshes the main page</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page#p30464</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/instead-of-just-the-grid-triggerreloadgrid-refreshes-the-main-page#p30464</guid>
        	        	<description><![CDATA[</p>
<p>//load the empty grid</p>
</p>
<p>jQuery("#customerResults").jqGrid({</p>
<p>datatype: &#39;local&#39;,</p>
<p>loadonce:true,</p>
<p>colNames:[ &#39;Address&#39;],</p>
<p>colModel:[ {name:&#39;addrLineTxt&#39;,index:&#39;addrLineTxt&#39;, editable:false}],</p>
<p>autowidth:true,</p>
<p>height: &#39;auto&#39;,</p>
<p>rowList:[],</p>
<p>pgbuttons:false,</p>
<p>pgtext:null,</p>
<p>viewrecords: true,</p>
<p>pager: &#39;#customerResultPager&#39;,</p>
<p>caption:"Customer Search Result",</p>
<p>shrinkToFit: true,</p>
<p>});</p>
<p>&#160;jQuery("#customerResults").jqGrid(&#39;navGrid&#39;,&#39;#customerResultPager&#39;,{search:false, add:false, edit:false, del:false},  						{},	{ }, {}, {} );</p>
</p>
<p>//This is event for external form to refresh grid based on certain search criteria.</p>
<p>$("#customerSearchForm").submit(function (e) {</p>
<p>e.preventDefault();</p>
<p>$.ajax({</p>
<p><span style="white-space:pre"> </span>type:"post",</p>
<p><span style="white-space:pre"> </span>data: $(&#39;form:first&#39;).serialize(),</p>
<p><span style="white-space:pre"> </span>url: $(&#39;form:first&#39;).attr(&#39;action&#39;),</p>
<p><span style="white-space:pre"> </span>success: function(response){</p>
<p><span style="white-space:pre"> </span>$(&#39;#customerResults&#39;).jqGrid(&#39;clearGridData&#39;);</p>
<p><span style="white-space:pre"> </span>$(&#39;#customerResults&#39;).jqGrid().setGridParam({ data: response.rows, datatype:&#39;json&#39;, }); //Everything fine till this line. And	 response.rows has records.</p>
<p><span style="white-space: pre;"> </span>$("#customerResults").jqGrid().trigger("reloadGrid", [{page:1} ]); 				} 			}); //This line causes the page to refresh so that Insted of grid with data I see the fresh grid.&#160;</p>
<p>//I see 2 calls made to the server. one to post the result and another one the url of the page containing grid. If I comment trigger("reloadGrid"), I only see one call to server but the data is not refreshed on the grid.<img class="spSmiley" style="margin:0" class="sfsmiley" title="Yell" src="http://www.trirand.com/blog/wp-content/forum-smileys/sf-yell.gif" alt="Yell" /></p>
<p>});</p>
]]></description>
        	        	<pubDate>Mon, 07 Apr 2014 22:33:06 +0300</pubDate>
        </item>
</channel>
</rss>