On Thu, May 15, 2008 at 2:49 PM, afan pasalic <afan@xxxxxxxx> wrote: > > > Iv Ray wrote: >> afan pasalic wrote: >>> this one bugs me for a while. how to change order. >>> >>> I have a list of tasks. by status, task could be 1 (todo) or 0 (done) - >>> status value stored in mysql. I can list tasks per status or all. >>> order number is stored in mysql too. >>> the easiest way to change order is to have form for each task where you >>> will enter manually number and then submit (one submit button for whole >>> form). but, if you change order number for any task you have to change >>> then all order numbers "below" the task manually >>> >>> solution with "arrows" (or up/down buttons) where you click on arrow and >>> the task switch the place with its "neighbor" is easy and fancy. Though, >>> I get in trouble if, e.g. tasks 10, 11, 12, and 13 change status from 1 >>> to 0 and I have to move task 14 to place 6. I have to click first 4 >>> times (to switch places with tasks 13, 12, 11, and 10) - but nothing is >>> actually happening on screen (of course) before start switching places >>> with 9, 8, 7, and 6. >>> >>> how do you avoid this "gap"? >>> what solution do you use at all? >> >> You have two different issues - a) how to execute the change, and b) >> what interface to provide. >> >> To execute the change, basically you have to reorder. The best >> algorithm is question of mathematics - you can implement "something" >> and improve it independently from the interface. >> >> As for the interface, the first is kind of the simplest, but somehow >> primitive. The second is a bit better, but you have noticed, not much >> better. The most elegant, considering the time we live in, would be >> drag & drop AJAX (here - http://tool-man.org/examples/, there are >> excellent examples, perhaps there are more). >> >> It's also a question if tasks really need to be reordered manually. If >> all tasks have a deadline, you might sort them by date. If some don't, >> you can provide them unsorted, until they get one. Sorting tasks by >> moving them up/down works when you have 25 tasks, but it does not work >> when you have 50, 100, 1 000 (if you are a team leader and have 5-7 >> people team) - in that case sort by date might be better. >> >> If you get more advanced, and store time needed to complete a task, >> you could automatically shift all tasks (of a person) - when one gets >> delayed or takes longer, than planned. >> >> Hope that helps, >> Iv > > thanks Iv, > though, in my case, the task list will never be more then 25 and we can > talk about "small" list. > and, I need to sort them by order_no (bitter to say "priority_no") > > thanks for link. the Dag & Drop sortable list is really cool! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I use this: http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php