<?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: row dragndrop reordering vs header column width</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/row-dragndrop-reordering-vs-header-column-width</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/row-dragndrop-reordering-vs-header-column-width/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on row dragndrop reordering vs header column width</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/row-dragndrop-reordering-vs-header-column-width#p16794</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/row-dragndrop-reordering-vs-header-column-width#p16794</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks for this and it is true.</p>
<p>The tableDnD is no more supported. Insted use sortableRows method (provided with the grid jquery ui addons)</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 29 Apr 2010 11:56:53 +0300</pubDate>
        </item>
        <item>
        	<title>szhbug on row dragndrop reordering vs header column width</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/row-dragndrop-reordering-vs-header-column-width#p16643</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/row-dragndrop-reordering-vs-header-column-width#p16643</guid>
        	        	<description><![CDATA[<p>I have a basic grid (loaded via url property, datatype=json) and enabled row drag-n-drop as specified in documentation, i.e.:</p>
<p>$("#table_t").tableDnD({scrollAmount:0})</p>
<p>gridComplete: function() {<br />&#160;&#160;&#160;&#160; $("#_empty","#table_t").addClass("nodrag nodrop");<br />&#160;&#160;&#160;&#160; jQuery("#table_t").tableDnDUpdate();<br />},</p>
<p>and it works, however if I drag the first row out of the first place, column width of all the rows immidiately changes and does not match column widths in the header!&#160;</p>
<p>I have the width of the table well over the sum of the default width of the columns</p>
</p>
<p>If I later move the original first row into the first place - then everything become ok again(header column width == table column width), even if I change the header column width in the mean time.</p>
</p>
<p>I investigated the problem - jqgrid assignes the width value only to the original first row, all others have empty width value; so if after drag-n-drop it becomes non-first (2 cases: move the first out or move some other to the first place),&#160; the column widthes resize to some defaults which do not correspond with the jqgrid table header which is another table in html.&#160;</p>
<p>note: I have the width of the table well over the sum of the default width of the columns.</p>
</p>
<p>Even more, when resizing the header columns, jqgrid updates the column width of the ORIGINAL first row, not the current first row, which is also wrong, as it does not sync the column width.</p>
</p>
<p>I fixed the problem using following hack, but that is a little bit ugly way:</p>
<p>loadComplete: function(req){<br />&#160;&#160;&#160; $("#table_t").tableDnD({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; onDragStart: function(tbl, dragrow) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rh = $("#gview_table_t"+" table.ui-jqgrid-htable thead tr").get(0);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rows = tbl.tBodies[0].rows;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rfix = rows.length &#62; 1 &#38;&#38; rows[0].id == dragrow.id ? rows[1] : dragrow;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for(var c=0; c &#60; rows[0].cells.length; c++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows[0].cells.item(c).style.width =&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rfix.cells.item(c).style.width =&#160; //drag row may become the first</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160; rh.cells.item(c).style.width;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
</p>
<p>P.S.&#160;</p>
<p>versions:</p>
<p>jquery-1.3.2.min.js</p>
<p>jquery-ui-1.7.2.custom.min.js</p>
<p>jquery.tablednd_0_5.js</p>
<p>jqGrid&#160; 3.6.4</p>
<p>Firefox 3.5.9</p></p>
]]></description>
        	        	<pubDate>Sat, 24 Apr 2010 11:34:20 +0300</pubDate>
        </item>
</channel>
</rss>