<?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: .trigger('reloadGrid') not work.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work</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/triggerreloadgrid-not-work/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>destells on .trigger('reloadGrid') not work.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27740</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27740</guid>
        	        	<description><![CDATA[<p>Hello.</p>
</p>
<p>I had the same problem and I solved it as follow:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4930' value='Select Code' data-codeid='sfcode4930' /></p>
<div class='sfcode' id='sfcode4930'>
<p>jQuery(&#39;grid&#39;).jqGrid(&#39;clearGridData&#39;);<br />jQuery(&#39;grid&#39;).jqGrid(&#39;setGridParam&#39;, {data: dataToLoad});<br />jQuery(&#39;grid&#39;).trigger(&#39;reloadGrid&#39;);</p>
</div>
<p>Best regards.</p>
]]></description>
        	        	<pubDate>Thu, 15 Nov 2012 14:45:31 +0200</pubDate>
        </item>
        <item>
        	<title>dubeyniraj2010@gmail.com on .trigger('reloadGrid') not work.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27738</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27738</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>the problem with setGridParam is that it appends parameter&#160;values and not replaces&#160;to solve this you will have to first set parameter values to null, then reset them with new values.</p>
<p><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">jq(</span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">"#list"</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">).setGridParam({ postData: </span></span><span style="font-size: x-small; font-family: Consolas; color: #0000ff;"><span style="font-size: x-small; font-family: Consolas; color: #0000ff;"><span style="font-size: x-small; font-family: Consolas; color: #0000ff;">null</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;"> });</span></span></p>
<p><span style="font-size: x-small; font-family: Consolas;"></span></p>
<p><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">jq(</span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;#list&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">).setGridParam({ postData: { </span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;_ItemNo&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">: jq(</span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;#item&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">).val(), </span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;_Variant&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">: jq(</span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;#itemVariant&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">).val() } }).trigger(</span></span><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;"><span style="font-size: x-small; font-family: Consolas; color: #a31515;">&#39;reloadGrid&#39;</span></span></span><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;">);</span></span></p>
<p><span style="font-size: x-small; font-family: Consolas;"><span style="font-size: x-small; font-family: Consolas;"></span></span></p>
<p>Best Regards,</p>
<p>Niraj</p></p>
]]></description>
        	        	<pubDate>Thu, 15 Nov 2012 10:56:54 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on .trigger('reloadGrid') not work.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27570</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27570</guid>
        	        	<description><![CDATA[<p>I suppose that the problem exist because old data values will be not removed by</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6595' value='Select Code' data-codeid='sfcode6595' /></p>
<div class='sfcode' id='sfcode6595'>jQuery(&#34;#myJqGrid&#34;).jqGrid(&#39;setGridParam&#39;, { data: data });</div>
<p>The above code works good with empty <em>data</em>, but it could worrk wrong if another (old) data already exist. What you can do is setting the data array using <em>getGridParam</em>:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8960' value='Select Code' data-codeid='sfcode8960' /></p>
<div class='sfcode' id='sfcode8960'>var referenceToInternalData = jQuery(&#34;#myJqGrid&#34;).jqGrid(&#34;getGridParam&#34;, &#34;data&#34;);<br />referenceToInternalData&#160;= data;</div>
<p>or just</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5583' value='Select Code' data-codeid='sfcode5583' /></p>
<div class='sfcode' id='sfcode5583'>jQuery(&#34;#myJqGrid&#34;)[0].p.data = data;</div>
<p>because <em>jQuery("#myJqGrid")[0].p</em>&#160;represents the internal parameters of jqGrid.</p>
<p>The reason of the problem is that <em>setGridParam</em> uses <a href="http://api.jquery.com/jQuery.extend/" target="_blank">jQuery.extend</a> internally&#160;(see <a href="https://github.com/tonytomov/jqGrid/blob/v4.4.1/js/grid.base.js#L2640-2644" target="_blank">the source code</a> of jqGrid). One uses</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3572' value='Select Code' data-codeid='sfcode3572' /></p>
<div class='sfcode' id='sfcode3572'>jQuery.extend(true, this.p, {data: data});</div>
<p>So the object <em>{data: data}</em>&#160;will be recursively merged with the old options of the grid (with <em>jQuery("#myJqGrid")[0].p</em>). You can read in the documentation of jQuery.extend:</p>
<blockquote>
<p>On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.</p>
</blockquote>
<p>So the old <em>data</em> values will be <strong>merged instead of replacing</strong> by <em>setGridParam</em>.</p>
</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Thu, 18 Oct 2012 19:30:40 +0300</pubDate>
        </item>
        <item>
        	<title>justinkneff on .trigger('reloadGrid') not work.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27569</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27569</guid>
        	        	<description><![CDATA[<p>Try adding the following parameters to foce the data type too:</p>
<pre>&#160;$(&#39;#myJqGrid&#39;).setGridParam({&#160;page:&#160;1,&#160;datatype:&#160;"json"&#160;}).trigger(&#39;reloadGrid&#39;);
</pre>
]]></description>
        	        	<pubDate>Thu, 18 Oct 2012 15:42:12 +0300</pubDate>
        </item>
        <item>
        	<title>Bulgarin on .trigger('reloadGrid') not work.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27559</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/triggerreloadgrid-not-work#p27559</guid>
        	        	<description><![CDATA[<p>Hello.</p>
<p>I have a problem &#8211; My grid can&#39;t refresh&#8230; I add a button to  delete a file from my system. In the end of &#39;onclick&#39;-method for this  button I have</p>
<blockquote>
<p>$.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;MyPage,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: "{}",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: "json",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: "application/json; charset=utf-8&#8243;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function(data) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#myJqGrid").jqGrid(&#39;setGridParam&#39;, { data: data }).trigger(&#39;reloadGrid&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
</p>
</blockquote>
<p>And with this I get new data from codebehind method in "MyPage" (this  is aspx page). &#39;data&#39;-object has new values , set it to grid&#39;s data,  but not refresh the grid with new values.</p>
<p>Can you help me?</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Wed, 17 Oct 2012 12:40:59 +0300</pubDate>
        </item>
</channel>
</rss>