<?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: Local Array and rowid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid</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/local-array-and-rowid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Romyn on Local Array and rowid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7522</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7522</guid>
        	        	<description><![CDATA[<p>Thanks for that Tony - all working now with id=0 etc.</p>
]]></description>
        	        	<pubDate>Sat, 27 Jun 2009 13:08:02 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Local Array and rowid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7371</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7371</guid>
        	        	<description><![CDATA[<p>Hello Romyn,</p>
<p>Thanks again for your investigationns.</p>
<p>Also you are right there is a problem when we want to insert rowid = 0 in addRowData method. Also corrected in GitHub. Thanks.</p>
<p>Now about your problem.</p>
<p>IMHO it is a good idea in your case to have a global counter for the length of the rows in the grid. That is after you insert the data you can do</p>
<p>mycounter = myarray.length, where the myarray is a data added in the grid.</p>
<p>Then you can use afterSubmit event like this</p>
</p>
<p>afterSubmit : function (data, postdata) {</p>
<p>mycounter++;</p>
<p>return [true,"",myconter];</p>
<p>}</p>
<p>This way you will have in all cases uniquie id instead that you delete something from the grid.</p>
<p>Best Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Sun, 21 Jun 2009 06:22:52 +0300</pubDate>
        </item>
        <item>
        	<title>Romyn on Local Array and rowid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7333</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/local-array-and-rowid#p7333</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Been searching for a while and am getting closer but think it&#39;s time to ask for help on this one.</p>
</p>
<p>I have a grid I fill with initial values from a local array. While I&#39;d like to set the rowid to the same as the array&#39;s index for each row it seems that it&#39;s not possible to set the first one as rowid=0 so I&#39;ve got used to the idea of having rowid = array_index +1. (If it is possible to synch them together that would be great).</p>
</p>
<p>However that&#39;s not really the main question. I&#39;ve run into the issue of the rowid being set to +1 from the rowcount when adding a new row via editGridRow(new) and if I&#39;ve deleted a row before I get duplicate rowids.</p>
</p>
<p>It seems I should be using AfterSubmit but I&#39;m not sure how or whether that would work for local data. What I want to do is set the rowid for the new record to a specific number. Can someone help me as to how this should be done.</p>
</p>
<p>Also will this new rowid be the one that would be used in the subsequent afterInsertRow function I have - or will it be the one that is automatically assigned?</p>
</p>
<p>Hope that makes sense and someone will take pity on my hopelessness.</p>
</p>
<p>Thanks</p>
<p>Romyn</p>
]]></description>
        	        	<pubDate>Thu, 18 Jun 2009 23:06:25 +0300</pubDate>
        </item>
</channel>
</rss>