Re: changing order of items
| From: | Nathan Rixham | Date: | Thu, 15 May 2008 21:36:42 +0000 |
| Subject: | Re: changing order of items | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274395@lists.php.net to get a copy of this message | ||
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? thanks for any help. -afanflex 3 / dataset would handle all this for you extremely easily. if you want to stick with html then I'd recommend splitting into two tables (todo / done) and having a simple ajax updater to re-order the tables.