<?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: setSelection does not select after reloadGrid (potential bug)</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug</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/setselection-does-not-select-after-reloadgrid-potential-bug/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jplevene on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p29679</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p29679</guid>
        	        	<description><![CDATA[<p>You are all making a simple mistake. &#160;To select the first row in the jqgrid after the data has loaded use the following:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4999' value='Select Code' data-codeid='sfcode4999' /></p>
<div class='sfcode' id='sfcode4999'>gridComplete: function()<br />{<br /><span style=&#34;&#34;&#34;white-space:&#34;&#34;> </span>// Select second row as first is the title<br /><span style=&#34;&#34;&#34;white-space:&#34;&#34;> </span>$(&#34;#grid tr&#34;).eq(1).trigger(&#34;click&#34;);<br />}</div>
<p><img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /></p>
]]></description>
        	        	<pubDate>Tue, 15 Oct 2013 21:20:57 +0300</pubDate>
        </item>
        <item>
        	<title>tony on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p25219</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p25219</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You canb call setSelection AFTER reload the grid and not before.</p>
<p>Also a good choice is to call setSelection with setTimeout function to give a grid a time to refresh its data.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 23 Nov 2011 08:35:17 +0200</pubDate>
        </item>
        <item>
        	<title>alb84 on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p25206</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p25206</guid>
        	        	<description><![CDATA[<p>I have a jqGrid created when my page loads.</p>
<p>When I update or delete a row I use the methods setRowData or delRowData to update the grid withour reloading it.</p>
<p>Yet when I add a row, I cannot use addRowData because the sorting is wrong.</p>
<p>So I add the row in the database and then reload the grid.</p>
<p>But I want the new inserted row selected.</p>
<p>So I call setSelection, but the reloadGrid fires after the setSelection and so my row is not selected.</p>
<p>So I need to assign a callback to the loadComplete event, but my grid is already created when I want to assign the callback to the loadComplete event... is there a way to do this?</p></p>
]]></description>
        	        	<pubDate>Tue, 22 Nov 2011 15:21:39 +0200</pubDate>
        </item>
        <item>
        	<title>dluis on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p23325</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p23325</guid>
        	        	<description><![CDATA[<p>I&#39;m having the same problem with version 4 of JQGrid.</p>
</p>
<p>What I found was that after a <strong>trigger("reloadGrid");</strong>&#160;the setSelection scrolls to the position, selects the row in the background&#160;BUT it will not make the selection visible. Only after I sort the data or click refresh it will select the item. My grid type is JSON.</p>
</p>
<p>I know that the setSelection in the background selects the row because I have a reload of another grid onSelectRow. That problem here is that the Row is not getting the CSS Classes ui-state-hover ui-state-highlight.</p>
</p>
<p><strong><span style="color: #ff6600;">UPDATE: Just found that If I call &#160;$("#grid").jqGrid("resetSelection"); before the SetSelection the Selection is made in the GridComplete!</span></strong></p>
]]></description>
        	        	<pubDate>Wed, 25 May 2011 20:16:17 +0300</pubDate>
        </item>
        <item>
        	<title>aime42 on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16256</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16256</guid>
        	        	<description><![CDATA[<p>Thanks Tony,</p>
<p>Using only gridComplete works fine for me now.<img class="spSmiley" style="margin:0" title="Cool" src="/blog/wp-content/forum-smileys/sf-cool.gif" alt="Cool" /></p>
<p>Regards,</p>
<p>Aime</p>
]]></description>
        	        	<pubDate>Tue, 06 Apr 2010 17:14:23 +0300</pubDate>
        </item>
        <item>
        	<title>tony on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16209</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16209</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>@unknown</p>
<p>try this instead</p>
<p>$(&#39;#grid_waregroups tbody tr:first&#39;).trigger("click");</p>
<p>Note that I replace first-child with firs.</p>
</p>
<p>@Aime</p>
<p>a gridComplete should be used only. It is quiet possible that in loadComplete the row is selected, but in gridComplete it will be deselected &#8211; the setSelection is a toggle function.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 03 Apr 2010 17:16:50 +0300</pubDate>
        </item>
        <item>
        	<title>phamtranquocviet on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16151</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16151</guid>
        	        	<description><![CDATA[<p>Thanks Tony. Your workaround work for me.</p>
<p>I reset url to aAction=RefreshData before reloadding the grid because&#160; want to force server to query db. There are other cases where aAction=loadData which can be either query db if never queried before or reuse data stored in session if queried before. Just to save some performance.</p>
<p>Thanks again.</p>
]]></description>
        	        	<pubDate>Thu, 01 Apr 2010 17:42:39 +0300</pubDate>
        </item>
        <item>
        	<title>aime42 on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16150</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16150</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have a similar problem. I would like to select the first row after a grid reloading.</p>
<p>What I tried did not do what I expected.</p>
<p>Here is my code :</p>
<blockquote>
<p>$("#accountGrid").jqGrid({<br />&#160;&#160; &#160;url: g_account_url,<br />&#160;&#160; &#160;datatype: "json",<br />&#160;&#160; &#160;caption: "AccountList",<br />&#160;&#160; &#160;colNames:[ "account_id", "Label", "Currency", "Balance" ],<br />&#160;&#160; &#160;colModel:[<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:"account_id",index:"account_id", width:1, hidden:true, key:true},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:"account_label",index:"account_label", width:180},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:"currency_code",index:"currency_code", width:180},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:"balance_amount",index:"balance_amount", width:180},<br />&#160;&#160; &#160;],<br />&#160;&#160; &#160;height: "150px",<br />&#160;&#160; &#160;autowidth: true,<br />&#160;&#160; &#160;onSelectRow: f_select_account,<br />&#160;&#160; &#160;loadComplete: function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;$("#accountGrid").setSelection($("#accountGrid").getDataIDs()[0],true);<br />&#160;&#160; &#160;},<br />&#160;&#160; &#160;gridComplete: function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;$("#accountGrid").setSelection($("#accountGrid").getDataIDs()[0],true);<br />&#160;&#160; &#160;}<br />});</p>
</p>
<p>Thanks for your help,</p>
<p>Regards,</p>
<p>Aime</p>
</blockquote>
]]></description>
        	        	<pubDate>Thu, 01 Apr 2010 17:05:48 +0300</pubDate>
        </item>
        <item>
        	<title>unknown on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16149</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16149</guid>
        	        	<description><![CDATA[<p>So have my workaround:</p>
</p>
<p>$(&#39;#grid_waregroups tbody tr:first-child&#39;).click();</p>
</p>
<p>I know and I see other examples where setSelection is used and it worked perfektly ... but in my code it does it not ;( If you need some code just say it I will give it to you.</p>
</p>
<p>Greetings from Germany</p>
]]></description>
        	        	<pubDate>Thu, 01 Apr 2010 16:23:26 +0300</pubDate>
        </item>
        <item>
        	<title>unknown on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16147</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16147</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I have the same problem in funktions like gridComplete and loadComplete. I do the following:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7972' value='Select Code' data-codeid='sfcode7972' /></p>
<div class='sfcode' id='sfcode7972'>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; setTimeout(function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#grid_orders&#39;).jqGrid(&#39;setSelection&#39;,&#39;1&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },500);</div>
</p>
<p>and I test this:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4232' value='Select Code' data-codeid='sfcode4232' /></p>
<div class='sfcode' id='sfcode4232'>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#grid_orders&#39;).jqGrid(&#39;setSelection&#39;,&#39;1&#39;);</div>
<p>And no row is selected 🙁</p>
<p>Oh I always use the last version of JQGrid with JQuery in your download-zip</p>
]]></description>
        	        	<pubDate>Thu, 01 Apr 2010 16:10:46 +0300</pubDate>
        </item>
        <item>
        	<title>tony on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16105</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p16105</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry no time to explain, but try this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5511' value='Select Code' data-codeid='sfcode5511' /></p>
<div class='sfcode' id='sfcode5511'>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").setGridParam({url: &#39;index.php?func=trainingmgr&#38;aAction=refreshData&#39;});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").trigger("reloadGrid");</p>
<p>setTimeout(function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").jqGrid(&#39;setSelection&#39;, "2&#8243;);</p>
<p>}, 500);</p>
</div>
<p>It will be good if you explain why we should do it this way.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 31 Mar 2010 19:05:02 +0300</pubDate>
        </item>
        <item>
        	<title>phamtranquocviet on setSelection does not select after reloadGrid (potential bug)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p15993</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/setselection-does-not-select-after-reloadgrid-potential-bug#p15993</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>setSelection does not select the row, whose id is 2, right after a reloadGrid.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").setGridParam({url: &#39;index.php?func=trainingmgr&#38;aAction=refreshData&#39;});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").trigger("reloadGrid");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#training").jqGrid(&#39;setSelection&#39;, "2");</p>
<p>setSelection can select the row, whose id is 2, when you take this line out: $("#training").trigger("reloadGrid");</p>
<p>Anybody experience same issue?</p>
<p>Thanks</p>
]]></description>
        	        	<pubDate>Sat, 27 Mar 2010 03:38:23 +0200</pubDate>
        </item>
</channel>
</rss>