<?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>WebDevStar &#187; Dynamic Programming</title>
	<atom:link href="http://webdevstar.com/category/dynamic-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdevstar.com</link>
	<description>Produce, Promote &#38; Profit like a Pro</description>
	<lastBuildDate>Fri, 11 May 2012 04:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to Create a Draggable Sort List</title>
		<link>http://webdevstar.com/how-to-create-a-draggable-sort-list/</link>
		<comments>http://webdevstar.com/how-to-create-a-draggable-sort-list/#comments</comments>
		<pubDate>Mon, 31 May 2010 16:45:29 +0000</pubDate>
		<dc:creator>Anwar</dc:creator>
				<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Dynamic Programming]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[drag to sort]]></category>
		<category><![CDATA[draggable sort list]]></category>

		<guid isPermaLink="false">http://webdevstar.com/?p=962</guid>
		<description><![CDATA[<a href="http://webdevstar.com/how-to-create-a-draggable-sort-list/" title="How to Create a Draggable Sort List"></a>One of my favorite features of a content management system is a drag to sort list. Something similar can be seen in systems like the widgets module in WordPress. Before I realized it was there, a few clients have asked &#8230;<p class="read-more"><a href="http://webdevstar.com/how-to-create-a-draggable-sort-list/">Read more &#187;</a></p><p><a href="http://webdevstar.com/how-to-create-a-draggable-sort-list/">How to Create a Draggable Sort List</a> is a post from: <a href="http://webdevstar.com">WebDevStar.com</a> | &copy; WebDevStar.com</p>
]]></description>
			<content:encoded><![CDATA[<a href="http://webdevstar.com/how-to-create-a-draggable-sort-list/" title="How to Create a Draggable Sort List"></a><p>One of my favorite features of a <a title="CMS" href="http://www.intranetjournal.com/php-cms/" target="_blank">content management system</a> is a drag to sort list. Something similar can be seen in systems like the widgets module in WordPress.</p>
<p>Before I realized it was there, a few clients have asked me to integrate these lists so they can better manage items for their website.</p>
<p>This is a relatively new dynamic web application feature that some sites may be using. I will show you how to implement one of these using simple techniques and tools.</p>
<p>First you will need <span id="more-962"></span>a Javascript Library called <a title="Get Scriptaculous" href="http://script.aculo.us/" target="_blank">Scriptaculous</a>. Download it and add to a directory where your main PHP files for this app will be.</p>
<p>You will need access to a database. I use MySQL, but if you are experienced with others, you may be able to adjust the codes accordingly.</p>
<p>The first PHP file you will create is a class file. In it you will add a database connection function and a main query function. You will also need to create 6 other core functions to run the application.</p>
<p>Here is an <a title="Class File" href="/examples/listsrt_class.txt" target="_blank">example class file</a> you can use. This can be changed accordingly to match your db settings. You will also need to create a database table with 4 fields. These are id, title, link and sort order.</p>
<p>Here&#8217;s a pic for reference.</p>
<p><img class="aligncenter size-full wp-image-964" title="This is how your table should look" src="http://webdevstar.com/articles/wp-content/uploads/2010/05/sbc-ex1.png" alt="db table example" width="500" height="286" /></p>
<p>Now that you have the basic core files setup, it&#8217;s time to do some interface scripting.</p>
<p>The next set of files you will create will be what the admin will see. These will be 5 files, one to display the main list, one to add new items, another to delete items, one to edit an item and finally a file to sort the items. Now I can&#8217;t just say go create&#8230;I have to give you some kind of reference.</p>
<p><a title="Get Files" href="/examples/sbcfiles.zip">Grab the files here.</a></p>
<p>Implement and start testing. You should be able to sort, reload and see your changes in effect. Because whatever you see in the admin, that&#8217;s the order it will be displayed on the front.</p>
<p>You will also have an ability to add, edit or delete a record. You can sort up or down. But beware, I&#8217;ve had problems when I displayed the list inline. The sort function still works but in an awkward way and not as smoothly.</p>
<p>Once you are satisfied that the application does what it needs to on the backend. You can now go ahead and display the list on the front. Style however you want. Changes are seen when you load the page and not live while looking at the page. So it won&#8217;t freak your visitors out, because they don&#8217;t see anything moving around while browsing. Here is an <a title="List example" href="/examples/wdss.txt" target="_blank">example file</a>.</p>
<p>Let me know if you enjoyed this tutorial. And if and how you use this sweet little app.</p>
<p>Note: by the way you have to change the extension of the example files to php.</p>
<p><a href="http://webdevstar.com/how-to-create-a-draggable-sort-list/">How to Create a Draggable Sort List</a> is a post from: <a href="http://webdevstar.com">WebDevStar.com</a> | &copy; WebDevStar.com</p>
<img src="http://webdevstar.com/articles/?ak_action=api_record_view&id=962&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://webdevstar.com/how-to-create-a-draggable-sort-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
