hellonoko Posted December 18, 2007 Share Posted December 18, 2007 I am building a todo list. Each item on the todo list has an up arrow and down arrow. When the user clicks the up or down arrow I want the ranking value of that todo list item to change so that the use can change the order of the items in the list. I have been working on a system but it is not working very well. Does anyone have a good idea for how to do this? Thanks for your time, ian Quote Link to comment Share on other sites More sharing options...
p2grace Posted December 18, 2007 Share Posted December 18, 2007 The best method I've found is when adding an item, the item's rank is the number of all rows in the table. Then when clicking up or down, the two row's rank swap places, successfully moving one up and one down. Quote Link to comment Share on other sites More sharing options...
hellonoko Posted December 18, 2007 Author Share Posted December 18, 2007 That is basically what I have come up with. But run into some issues when the ranks are out of order in the DB once they start moving around. 1 3 2 4 5 etc. was hoping id be lucky enough to find an implementation of it to take a look at. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.