<?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 of grid data does not work for grids with </title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with</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/bugs/reload-of-grid-data-does-not-work-for-grids-with/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on Reload of grid data does not work for grids with </title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21146</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21146</guid>
        	        	<description><![CDATA[<p>You welcome chillifire,</p>
<p>By the way I&#39;m also not so young&#160;<img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" />. I am 46. The problem with the correct usage of JavaScript and jQuery is well known for people who uses mostly other programming languages. I started to use JavaScript only about 1,5 years ago. At the time I worked more as halt of year on some web project (which was new for me), which used jqGrid&#160;intensively.&#160;After the end of the project l started to write answers in this forum and in the stackoverflow.com mostly to study JavaScript and jqGrid a little&#160;better. It has become a hobby for me last time.</p>
<p>As far as I know&#160;there are no possibilities&#160;in&#160;/) then I will probably see that and answer you it I could. On the stackoverflow you will be able to voting answers (and question)&#160;up and "accept" one from the answers, which have meaning close to "solved".</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sun, 05 Dec 2010 00:26:59 +0200</pubDate>
        </item>
        <item>
        	<title>chillifire on Reload of grid data does not work for grids with </title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21145</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21145</guid>
        	        	<description><![CDATA[<p>[SOLVED]</p>
<p>Indeed this soled the problem.l Brilliant!</p>
</p>
<p>I need to get used to the asynchronous nature of ajax. I am stuck in my procedural programming world. (Just goes to show my age <img class="spSmiley" style="margin:0" title="Smile" src="/blog/wp-content/forum-smileys/sf-smile.gif" alt="Smile" />)</p>
</p>
<p>BTW: Is there anyway to mark a topic as solved?</p>
<p>And to give ace responses like yours some kudos/feedback?</p>
</p>
<p>Anyway, many thanks, Oleg.</p>
]]></description>
        	        	<pubDate>Sat, 04 Dec 2010 23:57:07 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on Reload of grid data does not work for grids with </title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21143</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21143</guid>
        	        	<description><![CDATA[<p>Hello chillifire,</p>
<p>It seems to me that the reason of the problems which you has is the usage of the line</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5842' value='Select Code' data-codeid='sfcode5842' /></p>
<div class='sfcode' id='sfcode5842'>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;local&#39;});</div>
</p>
<p>or the lines</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6245' value='Select Code' data-codeid='sfcode6245' /></p>
<div class='sfcode' id='sfcode6245'>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;local&#39;});<br /> var allData = jQuery(&#34;#listSales&#34;).getGridParam(&#39;data&#39;);</div>
</p>
<p>after the <strong>jQuery("#listSales").trigger("reloadGrid")</strong>. The problem is that the loading of the JSON data from the server work&#160;<span style="text-decoration: underline;"><em>asynchronous</em></span>. Moreover your grid has already parameter <strong>loadonce:true</strong>. So the <strong>datatype</strong> will be switched automatically to <strong>&#39;local&#39;</strong> <em>after the server response will be processed</em> by jqGrid.</p>
<p>So I suggest you just to remove <strong>jQuery("#listSales").setGridParam({datatype:&#39;local&#39;})</strong> from your code. If you will want to get the value of&#160;<strong>data</strong> parameter after reloading of data you should do this <em>inside</em> of <strong>loadComplete</strong> event handler.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sat, 04 Dec 2010 23:18:42 +0200</pubDate>
        </item>
        <item>
        	<title>chillifire on Reload of grid data does not work for grids with </title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21142</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/reload-of-grid-data-does-not-work-for-grids-with#p21142</guid>
        	        	<description><![CDATA[<p>I have a grid that allows users to load data with different time horizons. Initially the first month&#39;s worth of transaction data is loaded. Users can press reload buttons to load 6, 12, or 18 months worth of data. I use a grid with loadonce:true. These reload with different time horizons are done through custom buttons like:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5753' value='Select Code' data-codeid='sfcode5753' /></p>
<div class='sfcode' id='sfcode5753'>jQuery(&#34;#listSales&#34;).jqGrid(&#39;navButtonAdd&#39;,&#39;#pager&#39;,{<br /><span style=&#34;white-space:pre&#34;> </span>caption:&#34;6 months&#34;, &#160; &#160; &#160; &#160;<br /><span style=&#34;white-space:pre&#34;> </span>title:&#34;Load 6 months sales history&#34;,&#160;<br /><span style=&#34;white-space:pre&#34;> </span>buttonicon:&#34;ui-icon-refresh&#34;,<br /><span style=&#34;white-space:pre&#34;> </span>onClickButton : function () {&#160;<br /><span style=&#34;white-space:pre&#34;> </span>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;json&#39;});&#160;<br /><span style=&#34;white-space:pre&#34;> </span>jQuery(&#34;#listSales&#34;).setGridParam({url:&#39;../json/sales?horizon=6&#39;});<br /><span style=&#34;white-space:pre&#34;> </span>jQuery(&#34;#listSales&#34;).trigger(&#34;reloadGrid&#34;);&#160;<br /><span style=&#34;white-space:pre&#34;> </span>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;local&#39;});&#160;&#160;&#160;&#160; &#160; &#160;&#160;<br /><span style=&#34;white-space:pre&#34;> </span>}&#160;<br />});&#160;</div>
<p>This approach is following the advice of Tony in the following post to enable data reloading for grids with datatype local: /blog/?page_id=393/feature-request/sortclientside-but-allow-trigger-reload-on-different-url-param/&#38;value=ajax%20reload&#38;type=2&#38;include=1&#38;search=2&#38;ret=all</p>
</p>
<p>Bug:</p>
<p>While the grid correctly reloads with the new URL as required, the data from the server is not written into the grids data store. The command</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6426' value='Select Code' data-codeid='sfcode6426' /></p>
<div class='sfcode' id='sfcode6426'>var allData = jQuery(&#34;#listSales&#34;).getGridParam(&#39;data&#39;);</div>
<p>after the reload shows that the original load with horizon=1 is still the data in the grid&#39;s data store. Note: The reloaded data is written into the visible grid, however the first visible page is empty and subsequent scrolls or sorts go back to the data store and suddenly we are back to the originally loaded data.</p>
<p>I am sure this is not the intended&#160;behavior, but a&#160;kink&#160;in the relatively new local data handling. Can this be fixed, please?</p>
<p>Appendix:</p>
<p>My full grid definition:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6622' value='Select Code' data-codeid='sfcode6622' /></p>
<div class='sfcode' id='sfcode6622'>
<p>jQuery(&#34;#listSales&#34;).jqGrid({</p>
<p>url:&#39;../json/sales?horizon=1&#39;,</p>
<p>datatype: &#34;json&#34;,</p>
<p>height: 450,</p>
<p>width: 980,</p>
<p>colNames:[&#39;ID&#39;, &#39;Sub-Account&#39;, &#39;Account&#39;, &#39;Partner&#39;, &#39;Admin&#39;, &#39;Transaction ID&#39;, &#39;Transaction date&#39;, &#39;Name&#39;, &#39;Email&#39;, &#39;Amount&#39;, &#39;Cur&#39;, &#39;Vocher&#39;, &#39;Received&#39;, &#39;Mobile&#39;, &#39;Package Id&#39;, &#39;Package Name&#39;, &#39;Expiration&#39;, &#39;User&#39;, &#39;User Mac&#39;, &#39;NasID&#39;, &#39;Router MAC&#39;],</p>
<p>colModel:[</p>
<p>{name:&#39;rowID&#39;,hidden: true},</p>
<p>{name:&#39;account&#39;,index:&#39;account&#39;, width:60},</p>
<p>{name:&#39;affiliate&#39;,index:&#39;affiliate&#39;, width:60},</p>
<p>{name:&#39;partner&#39;,hidden: true},</p>
<p>{name:&#39;admin&#39;,hidden: true},</p>
<p>{name:&#39;transid&#39;,index:&#39;transid&#39;, width:110},</p>
<p>{name:&#39;transdate&#39;,index:&#39;transdate&#39;, width:90},</p>
<p>{name:&#39;name&#39;,index:&#39;name&#39;, width:100},</p>
<p>{name:&#39;email&#39;,index:&#39;email&#39;, width:150},</p>
<p>{name:&#39;amountpaid&#39;,index:&#39;amountpaid&#39;, width:40, formatter: &#39;int&#39;},</p>
<p>{name:&#39;currency&#39;,index:&#39;currency&#39;, width:25},</p>
<p>{name:&#39;voucher&#39;,index:&#39;voucher&#39;, width:10,formatter:&#39;checkbox&#39;},</p>
<p>{name:&#39;youoweus&#39;,index:&#39;youoweus&#39;, width:10,formatter:&#39;checkbox&#39;},</p>
<p>{name:&#39;mobile&#39;,hidden: true},</p>
<p>{name:&#39;timeid&#39;,hidden: true},</p>
<p>{name:&#39;package&#39;,hidden: true},</p>
<p>{name:&#39;expiration&#39;,hidden: true},</p>
<p>{name:&#39;userid&#39;,hidden: true},</p>
<p>{name:&#39;mac&#39;,hidden: true},</p>
<p>{name:&#39;nasid&#39;,hidden: true},</p>
<p>{name:&#39;routermac&#39;,hidden: true},</p>
<p>],</p>
<p>rowNum:20,</p>
<p>loadonce:true,</p>
<p>scroll: 1,</p>
<p>mtype: &#34;GET&#34;,</p>
<p>rownumbers: true,</p>
<p>rownumWidth: 30,</p>
<p>gridview: true,</p>
<p>pager: &#39;#pager&#39;,</p>
<p>sortname: &#39;transdate&#39;,</p>
<p>ignoreCase: true,</p>
<p>loadui: &#34;block&#34;,</p>
<p>viewrecords: true,</p>
<p>sortorder: &#34;desc&#34;,</p>
<p>caption: &#34;&#60;?= $this-&#62;contentHeader ?&#62;&#34;,</p>
<p>footerrow : true,</p>
<p>userDataOnFooter : true,</p>
<p>altRows : true,</p>
<p>});</p>
<p>jQuery(&#34;#listSales&#34;).jqGrid(&#39;filterToolbar&#39;,{stringResult:true,searchOnEnter:false,defaultSearch:&#34;cn&#34;});</p>
<p>jQuery(&#34;#listSales&#34;).jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{del:false,add:false,edit:false,search:false,refresh:true},{},{},{});</p>
<p>jQuery(&#34;#listSales&#34;).jqGrid(&#39;navButtonAdd&#39;,&#39;#pager&#39;,{</p>
<p>caption:&#34;6 months&#34;,</p>
<p>title:&#34;Load 6 months sales history&#34;,</p>
<p>buttonicon:&#34;ui-icon-refresh&#34;,</p>
<p>onClickButton : function () {</p>
<p>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;json&#39;});</p>
<p>jQuery(&#34;#listSales&#34;).setGridParam({url:&#39;../json/sales?horizon=6&#39;});</p>
<p>jQuery(&#34;#listSales&#34;).trigger(&#34;reloadGrid&#34;);</p>
<p>jQuery(&#34;#listSales&#34;).setGridParam({datatype:&#39;local&#39;});</p>
<p>var allData = jQuery(&#34;#listSales&#34;).getGridParam(&#39;data&#39;);</p>
<p>}</p>
<p>});</p>
</div>
]]></description>
        	        	<pubDate>Sat, 04 Dec 2010 21:55:30 +0200</pubDate>
        </item>
</channel>
</rss>