<?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: After re-ordering columns, sorting maps data to original columns</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/after-re-ordering-columns-sorting-maps-data-to-original-columns</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/after-re-ordering-columns-sorting-maps-data-to-original-columns/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>earachefl on After re-ordering columns, sorting maps data to original columns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/after-re-ordering-columns-sorting-maps-data-to-original-columns#p28075</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/after-re-ordering-columns-sorting-maps-data-to-original-columns#p28075</guid>
        	        	<description><![CDATA[<p>Finally stumbled on the solution. I needed to pass the original order of the columns as an array to remapColumns, and also include the last param.:</p>
</p>
<p>sortable: {</p>
<p><span style="white-space: pre;"> </span>update: function (perm) {</p>
<p><span style="white-space: pre;"> </span>$("#mainGrid").jqGrid("remapColumns", [0,1,2,3,4,5,6,7,8,9,10,11,12], true, false);</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>},</p>
]]></description>
        	        	<pubDate>Thu, 17 Jan 2013 23:37:01 +0200</pubDate>
        </item>
        <item>
        	<title>earachefl on After re-ordering columns, sorting maps data to original columns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/after-re-ordering-columns-sorting-maps-data-to-original-columns#p28074</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/after-re-ordering-columns-sorting-maps-data-to-original-columns#p28074</guid>
        	        	<description><![CDATA[<p>I&#39;ve been tearing my hair out on this one. Whether I try to implement column re-ordering via header dragging or via the column chooser plugin, after re-ordering the columns, clicking on any column header to sort results in the sorted columns being loaded into their original positions in the table. I&#39;ve tried the suggestions posted here but nothing seems to work. Using the sortable method:</p>
</p>
<p>sortable: {<span style="white-space:pre"> </span></p>
<p><span style="white-space:pre"> </span>options: {</p>
<p><span style="white-space:pre"> </span>stop: function(event, ui){</p>
<p><span style="white-space:pre"> </span>// have tried putting the remapcolumns function inside stop() to no avail&#160;</p>
<p><span style="white-space:pre"> </span>$("#mainGrid").jqGrid("remapColumns", [0,1,2,3,4,5,6,7,8,9,10,11,12], true);</p>
<p><span style="white-space:pre"> </span>}</p>
<p><span style="white-space:pre"> </span>},</p>
<p><span style="white-space:pre"> </span>update: function (perm) {</p>
<p>&#160;<span style="white-space:pre"> </span>/*</p>
<p><span style="white-space:pre"> </span>&#160;*&#160;code to save the new colmodel goes here</p>
<p><span style="white-space:pre"> </span>*/</p>
<p><span style="white-space:pre"> </span>// the following line doesn&#39;t seem to do anything... just seems to return an array identical to &#39;perm&#39;</p>
<p><span style="white-space:pre"> </span>$("#mainGrid").jqGrid("getGridParam", "remapColumns");</p>
</p>
<p><span style="white-space:pre"> </span>// if included, the next line causes the headers to not move</p>
<p><span style="white-space:pre"> </span>$("#mainGrid").jqGrid("remapColumns", perm, true);&#160;</p>
</p>
<p><span style="white-space:pre"> </span>// this alternate allows them to move, but the newly sorted columns still get remapped to their original position</p>
<p><span style="white-space:pre"> </span>$("#mainGrid").jqGrid("remapColumns", [0,1,2,3,4,5,6,7,8,9,10,11,12], true);</p>
<p><span style="white-space:pre"> </span>}</p>
<p>}</p>
</p>
<p>After reordering, I can see that the data is being returned from the server in the expected order after sorting. What am I missing?&#160;</p>
</p>
<p>BTW, this is using jqGrid 4.4.1.</p>
]]></description>
        	        	<pubDate>Thu, 17 Jan 2013 22:53:00 +0200</pubDate>
        </item>
</channel>
</rss>