This contains a little javascript which might help you out - it's a bit archaic 
as it was written when I was learning javascript for the first time... but it 
works.

it automatically reorders a range of dropdowns based on your choice so it could 
be useful for such a thing... I use a derivation of it for all page/product 
ordering scripts...

- james



> -----Original Message-----
> From: Ayudh Nagara [mailto:[EMAIL PROTECTED]
> Sent: Monday, 31 January 2005 4:12 PM
> To: CFAussie Mailing List
> Subject: [cfaussie] Re: SQL ordering question
> 
> 
> 
>         
> Hey Ryan,
> I've done this sort of thing in a music server app where the 
> user can reorder songs in a playlist using up/down arrows. 
> You really want to avoid doing a mass db update if you can 
> help it. I used the following technique:
> 
> The order field should be just sequential with no gaps: 1,2,3,etc.
> When the user clicks up arrow on item 5, you update 2 records 
> (swap values 4 and 5)
> Likewise when the user clicks down arrow on item 5, swap 
> values 5 and 6 in the corresponding records. You get the picture.
> 
> Regards: Ayudh
> 
> +----------------------------------------------------------------+
> | SOAP is the glue! Hook up your server directly to your bank.   |
> | Connect to VeriPay xServ, the Australian Payments Web Service. |
> | Reliable, Secure, FAST: http://www.xilo.com/xserv              |
> +----------------------------------------------------------------+
> 
> 
> > I've developed a widget that allows a user to sort items by 
> clicking 
> > an up or a down arrow next to the item. To facilitate this here is 
> > what I do: 
> > 
> > 1. Have the ordering field separated by 10 
> > 2. When a user clicks the up arrow, subtract 15 from the ordering 
> > field, then re-sort the whole database, separating the items by 10. 
> > or when the user clicks down, add 15 then re-sort again. 
> > 
> > It also allows easily to insert a new item at any point, 
> just insert 
> > it and run the re-sort code again. 
> > 
> > Thinking about it now, I should probably do something 
> that's less work 
> > on the database, like just swap the 2 items... but this way was the 
> > easiest to quickly come up with in my head. 
> 
> 
> 
>         
> 
> ---
> You are currently subscribed to cfaussie as: 
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to 
> [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
> 
Title: JavaScript Page Sort
Page number 1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 2: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 3: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 4: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 5: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 6: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 7: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 8: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 9: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 10: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 11: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 12: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 13: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 14: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Page number 15: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to