<?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: Reload grid </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid</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/reload-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>penck on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20281</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20281</guid>
        	        	<description><![CDATA[<p>I use the version 3.8, but maybe my example found from internet is for the old version, I use just a normal web site in Visual Studio , and use json to pass the form data to server , search the data server , and produce the Json data with the function ToJson &#160;, at last , resend the Json to client side by reponse.write :</p>
<p>public string ToJson(ArrayList a, int colNumber)&#160;&#160; &#160; &#160; &#160;</p>
<p>{&#160;&#160; &#160; &#160; &#160; &#160; &#160;<span style="white-space:pre"> </span>StringBuilder stringBuilder = new StringBuilder("{"); &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space:pre"> </span>&#160;stringBuilder.Append("total: " + SurrondWithQuote(10) + ", ");&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space:pre"> </span>&#160;stringBuilder.Append("page: " + SurrondWithQuote(1) + ", ");&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space:pre"> </span>&#160;stringBuilder.Append("records: " + SurrondWithQuote(1) + ", ");&#160;&#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space:pre"> </span>stringBuilder.Append(" &#160;rows : [ ");&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space:pre"> </span>&#160;for (int i = 0; i &#60; a.Count ; i++)&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space:pre"> </span>&#160;{&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space:pre"> </span>string[] temp = a[i] as string[];&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>stringBuilder.Append("{");<br />&#160;<span style="white-space: pre;"> </span>stringBuilder.Append("id:" + SurrondWithQuote(i + 1) + ", ");&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>stringBuilder.Append("cell:[ ");&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;for (int j = 0; j &#60; colNumber; j++)&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>{&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;if (j + 1 != colNumber)&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;{&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>stringBuilder.Append(SurrondWithQuote(temp[j]) + ", ");&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>&#160;else&#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="white-space: pre;"> <br /></span><span style="white-space: pre;"> </span>&#160;stringBuilder.Append(SurrondWithQuote(temp[j])); &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>&#160;}&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;</p>
<p><span style="white-space: pre;"> </span>stringBuilder.Append(" ]");</p>
<p>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="white-space: pre;"> </span>&#160;if (i == a.Count - 1)&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;{&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;stringBuilder.Append(" }");&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;else&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;stringBuilder.Append(" },");&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}&#160;&#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>}&#160;&#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>stringBuilder.Append(" ]");&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;stringBuilder.Append(" }");&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;return stringBuilder.ToString();&#160;&#160; &#160; &#160; <br />&#160;}</p>
<p>&#160;</p>
]]></description>
        	        	<pubDate>Wed, 13 Oct 2010 09:11:30 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20246</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20246</guid>
        	        	<description><![CDATA[<p>Which version of the jqGrid you use? Could you post the test JSON data which you receive from the server (you can use <a href="http://www.fiddler2.com/fiddler2/" target="_blank">Fiddler</a> or Firebug to catch the data).</p>
<p>I would you not recommend to use datatype as function. If was&#160;introduced&#160;in old versions of jqGrid. Now one should use better parameters like <a href="http://stackoverflow.com/questions/2675625/setting-the-content-type-of-requests-performed-by-jquery-jqgrid/2678731#2678731" target="_blank">ajaxGridOptions</a>.&#160;</p>
<p>I find also a little strange, that your server page has extension <strong>aspx</strong> and not&#160;<strong>asmx</strong> (web service), <strong>svc</strong>&#160;(WCF service) or using ASP.NET MVC with <strong>no extension</strong> for the URL providing JSON data. Which technology &#160;you use on the server side to produce the JSON output? Wich version of .NET and which version of the Visual Studio you use?</p>
<p>If you gives more information about your server part and the jqGrid version used I&#39;ll try to post you some links with the corresponding examples.</p>
<p>Regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 14:41:00 +0300</pubDate>
        </item>
        <item>
        	<title>penck on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20244</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20244</guid>
        	        	<description><![CDATA[]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 14:08:04 +0300</pubDate>
        </item>
        <item>
        	<title>penck on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20243</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20243</guid>
        	        	<description><![CDATA[<p>Thanks for your reply ,</p>
<p>in fact , I&#39;ve tried this, used "&#160;jQuery("#productGridView").setGridParam({ datatype: getProducts});"&#160;<br />to reset the datetype.&#160;but it seems that does not work on my computer, server side never receive the&#160;<br />postback, and the jqgrid just redraw itself , each time, at the bottom , it add the icon for "search" and "refresh",&#160;<br />maybe there is a conflict of JS ?&#160;</p>
<p>here is my code, could you please check it and tell me where is my problem ? &#160;Thanks a lot &#160;</p>
</p>
<p>function getProducts() { &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>$.ajax({&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>url: "Test.aspx",&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>data: jsonData(), &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>dataType: "json",&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>type: "POST",&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br /><span style="white-space: pre;"> </span>success: successFunction&#160;&#160; &#160; &#160; &#160; &#160; <br /><span style="white-space: pre;"> </span>&#160;});&#160;&#160; &#160; &#160; &#160;</p>
<p>}</p>
<p>function dataBindToGrid() {</p>
<p>&#160;&#160;&#160; jQuery("#productGridView").jqGrid({</p>
<p>&#160;&#160;&#160; datatype: getProducts,</p>
<p>&#160;&#160;&#160; colNames: [&#39;TestCol1&#39;, &#39;TestCol2&#39;, &#39;TestCol3&#39;],</p>
<p>&#160;&#160;&#160; colModel: [{ name: &#39;TestCol1&#39;, index: &#39;TestCol1&#39;, width: 200, align: &#39;left&#39;, resizable: true },{ name: &#39;TestCol2&#39;, index: &#39;TestCol2&#39;, width: 200, align: &#39;left&#39;, resizable: true },{ name: &#39;TestCol3&#39;, index: &#39;TestCol3&#39;, width: 200, align: &#39;left&#39;, resizable: true }],</p>
<p>&#160;&#160;&#160; rowNum: 10,</p>
<p>&#160;&#160; &#160;autowidth: true,</p>
<p>&#160;&#160;&#160; rownumbers: true,</p>
<p>&#160;&#160;&#160; rowList: [5, 10, 20, 50, 100],</p>
<p>&#160;&#160;&#160; sortname: &#39;TestCol1&#39;,</p>
<p>&#160;&#160;&#160; pager: jQuery(&#39;#pageNavigation&#39;),</p>
<p>&#160;&#160;&#160; sortorder: "desc",</p>
<p>&#160;&#160;&#160; viewrecords: true,</p>
<p>&#160;&#160;&#160; multiselect: true,</p>
<p>&#160;&#160;&#160; height: 50,</p>
<p>&#160;&#160;&#160; loadonce: true,</p>
<p>&#160;&#160;&#160; gridComplete: function () {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;$("#productGridView").setGridParam({ datatype: &#39;local&#39; });</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160; jQuery("#productGridView").jqGrid(&#39;navGrid&#39;,&#39;#pageNavigation&#39;, &#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; {add:false,edit:false,del:false});</p>
<p>}</p>
<p>jQuery(document).ready(function () {</p>
<p>&#160;&#160;&#160; jQuery("#testButton1").click(function () {</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;jQuery("#productGridView").setGridParam({ datatype: getProducts});</p>
<p>&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160;dataBindToGrid();</p>
<p><span style="white-space:pre"> </span>});</p>
<p>});</p>
]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 14:08:02 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20238</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20238</guid>
        	        	<description><![CDATA[<p>Hi</p>
<p>Look at this <a href="http://stackoverflow.com/questions/3610173/problem-loading-data-in-details-jqgrid-from-master-grid/3613191#3613191" target="_blank">old answer</a>. You should just reset the datatype to "local" before reloading of the grid.</p>
<p>Regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 13:34:44 +0300</pubDate>
        </item>
        <item>
        	<title>penck on Reload grid </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20237</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reload-grid#p20237</guid>
        	        	<description><![CDATA[<p>Hi</p>
<p>I&#39;m a beginner in jqgrid . when I tried to use it, I&#39;ve met this problem :</p>
<p>&#160;I set loadonce= true, and set datatype="local", &#160;the grid is OK on the page .<br />and now I need to research the data from the server side and reload the grid ,<br />I tried some methods from internet , but doesn&#39;t work, or maybe I could not use&#160;<br />"loadonce = true" at this time ? &#160;</p>
<p>please help ....&#160;</p>
]]></description>
        	        	<pubDate>Tue, 12 Oct 2010 12:24:27 +0300</pubDate>
        </item>
</channel>
</rss>