Keep Data in User Defined Order-Real-Time Order Manipulation
Posted: Sun Apr 16, 2006 12:05 pm
OK I've got a really difficult problem here so If you can solve it you are probably an expert.
I need to build a web application where the user has control over the order records appear in. I need to do this in a simple and elegant way and also one what won't require rebuilding ids across entire tables. I'm looking to simulate the behavour of Winamp:

Winamp lets the user
I thought the solution to this problem would be a liked list type system which I just about managed to implement using MySQL and some stored procedures but it was far from elegant and I couldn't work out how to reorder without having to copy all the data out into a temporary table and then all back into the original table. That's something that would take a long time with any more than a couple of thousand rows.
In simple terms I need a flexible data storage method (XML?) and an awesome algorithm that orders things on the fly.
Any ideas? Thanks for any help that you can provide.
I need to build a web application where the user has control over the order records appear in. I need to do this in a simple and elegant way and also one what won't require rebuilding ids across entire tables. I'm looking to simulate the behavour of Winamp:

Winamp lets the user
- Select any number of records
- Select records ranges that are incontigious (can have gaps) - actually this is not essenuial
- Move them up or down
- Prevents overflow - Can't go over the edges
- Real time - or close
I thought the solution to this problem would be a liked list type system which I just about managed to implement using MySQL and some stored procedures but it was far from elegant and I couldn't work out how to reorder without having to copy all the data out into a temporary table and then all back into the original table. That's something that would take a long time with any more than a couple of thousand rows.
In simple terms I need a flexible data storage method (XML?) and an awesome algorithm that orders things on the fly.
Any ideas? Thanks for any help that you can provide.