<?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: Drag and Drop record count issue</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/drag-and-drop-record-count-issue</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/drag-and-drop-record-count-issue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>kalinwilson on Drag and Drop record count issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/drag-and-drop-record-count-issue#p21860</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/drag-and-drop-record-count-issue#p21860</guid>
        	        	<description><![CDATA[<p>I&#39;ve come across a couple of bugs/issues. I&#39;ll post each in a separate post.</p>
</p>
<p>I&#39;m using two grids to act as a multi-select control. The first grid is populated with local data resulting from an ajax query to the server. The rows from this grid can be dragged to a second grid which represents the selections.</p>
<p>Both grids have a footer row which displays the number of records in the grid. The footer is updated in the ondrop events and when the candidate grid is initially populated.</p>
<p>Here is the code for updateFooters():</p>
<blockquote>
<p>function updateFooters(){</p>
<p>&#160; var numCRecords = jQuery("#candidateList").jqGrid(&#39;getGridParam&#39;, &#39;reccount&#39;);</p>
<p>&#160; var numSRecords = jQuery("#selectedList").jqGrid(&#39;getGridParam&#39;, &#39;reccount&#39;);</p>
<p>&#160; jQuery("#candidateList").jqGrid(&#39;footerData&#39;, &#39;set&#39;, {name:numCRecords + &#39; candidates&#39;}, true);</p>
<p>&#160; jQuery("#selectedList").jqGrid(&#39;footerData&#39;, &#39;set&#39;, {name:numSRecords + &#39; candidates&#39;}, true);</p>
<p>}</p>
</blockquote>
<p>When the candidate list is initialized and the selected list is empty, the record counts are correct. When the first row is dragged to the selected list, the record count of the selected list is 2. When the next row is dragged to the selected list, the count remains 2 and is correct for subsequent additions or subtractions from the grid. My guess is the initial ghost row that acts as the drop target is retained after the first drop and throws off the count. That&#39;s a wild guess since I haven&#39;t dug into the code.</p></p>
]]></description>
        	        	<pubDate>Fri, 28 Jan 2011 05:35:58 +0200</pubDate>
        </item>
</channel>
</rss>