I've got an html table thus:
up | dn
[ ] Item 1
[x] Item 2
[ ] Item 3
[ ] Item 4
[x] Item 5
[ ] Item 6
[ ] Item 7
If 2 & 5 are checked and I click up, the result is:
up | dn
[x] Item 2
[x] Item 5
[ ] Item 1
[ ] Item 3
[ ] Item 4
[ ] Item 6
[ ] Item 7
If I click dn, the result is:
up | dn
[ ] Item 1
[ ] Item 3
[ ] Item 4
[ ] Item 6
[x] Item 2
[x] Item 5
[ ] Item 7
In other words, the items are grouped in the chosen direction, and then moved one row in that direction. Anyone have a good algorithm for this? I'm sure I can write something without much difficulty, but it seems like the kind of thing that should be "out there"....