| Script allows users to move rows up and down
on a table by simply double-clicking on the source row and then
again on the destination row. By using a double-click
event handler, one can avoid "clashing" with click events, thus,
allowing the scripts use to be isolated (installed without
breaking other scripts). |
|
- Basic system requirements and information:
-
IE 5.5+ ONLY
- Good for single tables Only (although could be expanded to include
multiple tables).
- No code is required to be within table element other than [<TABLE id="mainTable"
...] .
- Table row labels (TR) must be capitalized.
- Moving rows:
- Double-click on row (will change color) to be moved, Double-click on location to move
row.
- Note:
- If row to be moved is above the "future" location then the row will
be inserted below the "future" location double-clicked.
- If the row to be moved
is located below the "future" location then will be inserted above the "future"
location double-clicked.
- Reset system (2 ways to remove first double-click) - reset the highlight
conditions and rowID container:
- Pressing key "Esc".
- Double-click a second time on row that has been activated (double-clicked).
|
|
|
|
- ID's are auto-generated for each row in table in format "id#r".
- onmouseover handler highlights row (whether row has been
double-clicked or not).
- onmouseout handler returns to original color (whether row has
been double-clicked or not).
- first ondblclick turns background to "on double click" color, and
sets the rowID container to ID of row to be moved until second double-click
location is picked or the system is reset.
- second ondblclick moves row, turns background back to original
color, and resets the rowID container.
- row ID storage container: ID of the row most recently
double-clicked will be stored in a hidden input element located on the page.
- All cells in "mainTable" are rendered "unselectable" to stop text from
being selected during the double-click event.
|
|
|
Either download the .zip file containing everything
here |
|