[thelist] SQL user-defined order

Stephen Rider evolt_org at striderweb.com
Wed Oct 10 12:08:14 CDT 2007


I suppose that if order_id allows decimals, you could use that.  No  
crowding issues when you can always go one more place over.

I'm on a mailing list for WordPres programmers, and somebody recently  
did something very much like this.  I'll just paste from that email,  
but you might find his code helpful.  (WordPress is done in PHP and  
MySQL, By the way...):

> I have now made the final
> adjustments to the ajax page ordering functionality, including some  
> of the
> suggestions given and with all the bugs fixed (hopefully). It is  
> now paging
> at 20 items (I found it to be the ideal balance, but changing this  
> number
> takes no effort). The animation is now a "fade in/fade out" effect,  
> which I
> think looks less aggressive/jumpy, but that can be changed very  
> easily as
> well.
>
> I put it together in two ways: a complete wordpress package (
> http://www.bernardopadua.com/wordpress/downloads/ 
> wordpress_with_page_ordering_19_september_2007.zip)
> and a patch (
> http://www.bernardopadua.com/wordpress/patches/ajax%20sortable% 
> 20pages%20for%20wp.19-09-07.patch).
> I have updated my sandbox (
> http://bernardopadua.com/wp-sandbox/19-sep-2007/wp-admin/edit- 
> pages.php)
> where you guys can test it (user: test / pass: test).
>
> Please, check this post for more information:
> http://bitsinashortbit.wordpress.com/2007/09/16/the-final-bits-of- 
> gsoc/
>
> If you are interested in using the jQuery plugins that were  
> developed to
> provide this functionality, take a look at:
> http://nestedsortables.googlecode.com/


Hope it helps!  :)

Stephen

On Oct 10, 2007, at 11:44 AM, Matt Slocum wrote:

> I'm actually doing a lot of DOM scripting already. When the user
> rearranges the list in the browser I need the changes saved in the
> database. There probably won't be more than 50 records, but my
> personality wants to do it efficiently.
>
> Also, I'm using AJAX to submit the new arrangement every time there is
> a change. So if the user completely rearranges even 50 items, it will
> go through all the work for each change.
>



More information about the thelist mailing list