<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brian Grinstead &#187; table</title>
	<atom:link href="http://www.briangrinstead.com/blog/tag/table/feed" rel="self" type="application/rss+xml" />
	<link>http://www.briangrinstead.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 10 Aug 2010 18:26:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Make Table Rows Sortable Using jQuery UI Sortable</title>
		<link>http://www.briangrinstead.com/blog/make-table-rows-sortable-using-jquery-ui-sortable</link>
		<comments>http://www.briangrinstead.com/blog/make-table-rows-sortable-using-jquery-ui-sortable#comments</comments>
		<pubDate>Thu, 30 Jul 2009 20:17:51 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cell]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery-ui]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sortable]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.briangrinstead.com/blog/?p=352</guid>
		<description><![CDATA[I wrote an article on the LANIT Development blog about a problem that I ran into when trying to set up a basic sortable table using jQuery UI. The columns would collapse down once the dragging began. This was fixed by adjusting the helper object for the sortable function. Check out the article for all [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://lanitdev.wordpress.com/2009/07/23/make-table-rows-sortable-using-jquery-ui-sortable/">wrote an article on the LANIT Development blog</a> about a problem that I ran into when trying to set up a basic sortable table using jQuery UI.  The columns would collapse down once the dragging began.</p>

<p><img src="http://briangrinstead.com/files/sotable-row-collapsed.png" alt="sortable-row-collapsed" title="sortable-row-collapsed" class="aligncenter size-full" /></p>

<p>This was fixed by adjusting the <a href="http://jqueryui.com/demos/sortable/#option-helper">helper object</a> for the sortable function.  Check out the <a href="http://lanitdev.wordpress.com/2009/07/23/make-table-rows-sortable-using-jquery-ui-sortable/">article</a> for all the details, but here is a sample of the code if you are just looking for the solution:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;color: #008000;">// Return a helper with preserved width of cells</span>
<span style="color: #003366; font-weight: bold;color: #0000FF;">var</span> fixHelper <span style="color: #339933;color: #000000;">=</span> <span style="color: #003366; font-weight: bold;color: #0000FF;">function</span><span style="color: #009900;color: #000000;">&#40;</span>e<span style="color: #339933;color: #000000;">,</span> ui<span style="color: #009900;color: #000000;">&#41;</span> <span style="color: #009900;color: #000000;">&#123;</span>
	ui.<span style="color: #660066;">children</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #009900;color: #000000;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #003366; font-weight: bold;color: #0000FF;">function</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #009900;color: #000000;">&#41;</span> <span style="color: #009900;color: #000000;">&#123;</span>
		$<span style="color: #009900;color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;color: #0000FF;">this</span><span style="color: #009900;color: #000000;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;color: #000000;">&#40;</span>$<span style="color: #009900;color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;color: #0000FF;">this</span><span style="color: #009900;color: #000000;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #009900;color: #000000;">&#41;</span><span style="color: #009900;color: #000000;">&#41;</span><span style="color: #339933;color: #000000;">;</span>
	<span style="color: #009900;color: #000000;">&#125;</span><span style="color: #009900;color: #000000;">&#41;</span><span style="color: #339933;color: #000000;">;</span>
	<span style="color: #000066; font-weight: bold;color: #0000FF;">return</span> ui<span style="color: #339933;color: #000000;">;</span>
<span style="color: #009900;color: #000000;">&#125;</span><span style="color: #339933;color: #000000;">;</span>
&nbsp;
$<span style="color: #009900;color: #000000;">&#40;</span><span style="color: #3366CC;color: #808080;">&quot;#sort tbody&quot;</span><span style="color: #009900;color: #000000;">&#41;</span>.<span style="color: #660066;">sortable</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #009900;color: #000000;">&#123;</span>
	helper<span style="color: #339933;color: #000000;">:</span> fixHelper
<span style="color: #009900;color: #000000;">&#125;</span><span style="color: #009900;color: #000000;">&#41;</span>.<span style="color: #660066;">disableSelection</span><span style="color: #009900;color: #000000;">&#40;</span><span style="color: #009900;color: #000000;">&#41;</span><span style="color: #339933;color: #000000;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.briangrinstead.com/blog/make-table-rows-sortable-using-jquery-ui-sortable/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
