<?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: Bug with idPrefix (duplicate idPrefix)</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix</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/bug-with-idprefix-duplicate-idprefix/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>maxfelipe on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26628</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26628</guid>
        	        	<description><![CDATA[</p>
<p>Shouldn&#39;t also this line be reversed on addRowData:</p>
<p>id = rowid;</p>
<p>rowid &#160;= t.p.idPrefix + rowid;</p>
<p>Done this way, when used with local data we are not really referencing the data array correctly.</p>
]]></description>
        	        	<pubDate>Fri, 18 May 2012 11:28:32 +0300</pubDate>
        </item>
        <item>
        	<title>maxfelipe on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26626</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26626</guid>
        	        	<description><![CDATA[<p>Looks like I answered my own question, or at least a way to make it work. Looks like since I was using json data with loadonce: true, the id lookup for a reload was using the "localReader" id, which defaults to _id_(in our case &#39;idPrefixxx&#39;). The reload then concatenates the idPrefix with the id retrieved from the row, leading to a duplicated idPrefix.  If we use key:true in a col in our model that also represents the id of the row, we are all set, as the reload method will take *that* id instead of the rowid.&#160;</p>
<p>I still think there is an issue with how the rowid is constructed, as we should never end up with a duplicated idPrefix</p>
</p>
<p>Saludos desde Costa Rica</p>
<p>Max</p>
]]></description>
        	        	<pubDate>Fri, 18 May 2012 09:25:58 +0300</pubDate>
        </item>
        <item>
        	<title>maxfelipe on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26625</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26625</guid>
        	        	<description><![CDATA[<p>I have the latest version (4.3.2) (with no code from github) and I&#39;m also seeing the issue when the grid is sorted. I don&#39;t think Klaus actually fixed the issue, he was just pointing where he things the issue happens.</p>
<p>Moreover, I think the issue happens with any reload of the grid (filtering, sorting, etc)</p>
<p>Thanks again tony for such a great plugin.</p></p>
]]></description>
        	        	<pubDate>Fri, 18 May 2012 08:11:28 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26556</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26556</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I hope that the problem is fixed.</p>
<p>Couild you please let us know which version is used.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 10 May 2012 15:12:14 +0300</pubDate>
        </item>
        <item>
        	<title>bigD on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26499</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p26499</guid>
        	        	<description><![CDATA[<p>Hi</p>
<p>We are also seeing this issue, can you elaborate on your solution? &#160;</p>
<p>Thanks</p>
]]></description>
        	        	<pubDate>Wed, 02 May 2012 06:59:50 +0300</pubDate>
        </item>
        <item>
        	<title>Klaus on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25719</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25719</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I&#39;ve verified the data, and it is totally correct, but then I&#39;ve found the exact position, when the problem happens ... it is the <strong>sortGrid</strong> call and not the addRowData!</p>
<p>After the data was added with addRowData the ids where still correct, but after calling the sortGrid method the ids got wrong (with double-prefix)!</p>
</p>
<p>Here are some more details about my configuration:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3974' value='Select Code' data-codeid='sfcode3974' /></p>
<div class='sfcode' id='sfcode3974'>tableSettings= {<br />&#160; idPrefix: &#34;pre_&#34;,<br />&#160; datatype: &#34;local&#34;,<br />&#160; colModel: [<br />&#160;&#160; &#160;{label: &#39;Name&#39;, name: &#39;name&#39;, index: &#39;name&#39;, jsonmap: &#39;name&#39;},<br />&#160;&#160; &#160;{label: &#39;ID&#39;,&#160;&#160; name: &#39;id&#39;,&#160;&#160; index: &#39;id&#39;,&#160;&#160; jsonmap: &#39;id&#39;}<br />&#160; ]<br />&#160; jsonReader: {<br />&#160;&#160;&#160; root: &#34;entries&#34;, <br />&#160;&#160; &#160;page: &#34;tablepage&#34;,<br />&#160;&#160;&#160; total: &#34;tablepagetotal&#34;,<br />&#160;&#160;&#160; records: &#34;tablerecords&#34;,<br />&#160;&#160;&#160; repeatitems: false,<br />&#160;&#160;&#160; id: &#34;id&#34;<br />&#160; },<br />&#160; ...<br />}</p>
<p>myData = [&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /* it doesn&#39;t matter if the ids are strings or int ... same bahaviour */<br />&#160;{id: &#34;1&#34;, name: &#34;test1&#34;},<br />&#160;{id: &#34;2&#34;, name: &#34;test2&#34;}<br />];</p>
<p>myTable.jqGrid(&#39;addRowData&#39;, &#34;id&#34;, myData);<br />myTable.jqGrid(&#39;sortGrid&#39;, &#39;name&#39;, true, &#39;asc&#39;);</p>
</div>
<p>Kind regards,<br />Klaus.</p></p>
]]></description>
        	        	<pubDate>Wed, 18 Jan 2012 19:07:11 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25718</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25718</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Do you have checked your myData?</p>
<p>Please veryfy that myData does not have any id with like pre_12 before it is added into the grid</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 18 Jan 2012 18:31:00 +0200</pubDate>
        </item>
        <item>
        	<title>Klaus on Bug with idPrefix (duplicate idPrefix)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25717</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/bug-with-idprefix-duplicate-idprefix#p25717</guid>
        	        	<description><![CDATA[<p>Hello!</p>
<p>After updating jqGrid to the latest releases (jqGrid 4.3.1, jQuery 1.7.1) and using the new idPrefix option for my grids I detected the following problem:</p>
<p>In some cases the idPrefix is added/used twice for the table rows id attribute (... id="<strong>pre_pre_12</strong>"). This problem seems to occur when using a grid with local data added via addRowData ...</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4532' value='Select Code' data-codeid='sfcode4532' /></p>
<div class='sfcode' id='sfcode4532'>
<p>myTable.jqGrid(&#34;clearGridData&#34;);<br />myTable.jqGrid(&#34;addRowData&#34;, &#34;id&#34;, myData);<br />myTable.jqGrid(&#39;sortGrid&#39;, &#39;name&#39;, true, &#39;asc&#39;);</p>
</div>
<p>jqGrid calls the following internal functions: addRowData and then addJSONData for each row ... I think this is the cause of the problem, why the prefix is added twice.</p>
</p>
<p>On the other hand, when using server side data (JSON) the ids are set correctly using the idPrefix only once. (... id="<strong>pre_12</strong>")</p>
</p>
<p>I&#39;ve solved the problem by checking each time the prefix is appended, if it is already included in the ID and only add it if not.</p>
<p>But I don&#39;t think this is a really good solution. Maybe someone who knows the jqGrid code better could provide a clean bugfix for that problem.</p>
</p>
<p>Kind regards,<br />Klaus.</p></p>
]]></description>
        	        	<pubDate>Wed, 18 Jan 2012 17:02:45 +0200</pubDate>
        </item>
</channel>
</rss>