View Full Version : Giving rows up/down functionality

11-11-2006, 12:21 AM
I've been charged with building a customize view page. Here's what I need to build, and after that I'll describe my dilemna.

There will be a grid (table if you will) of checkboxes, their respective labels, and an up and a down button. Clicking on up will order the row higher in the grid, and down will similarly change the order to one row lower. Not only do I need to visually realign these rows, but this order also needs to be captured and submitted.

My dilemna is primarily the "up" and "down" button functionality, visually that is. Does anyone have suggestions? Is there some sort of terminology that describes this "widget" I'm looking for? I'm having great difficulty even googling this because there doesn't seem to be a good way to describe it.

I've been denied access to attempt to write this in AJAX, so I'm down to JavaScript or DHTML. I know this could be done with JavaScript, but does any have any inkling as to whether it might be easier in JavaScript vs DHTML? I have no experience in DHTML and only limited experience in JavaScript - I'm more familiar with programming languages and classic HTML.


11-11-2006, 06:44 AM
DHTML isn't really anything in particular. It simply means dynamic HTML. The dynamic part can be achieved however you like. Javascript and/or css are the most usual methods. But, a host of other techniques have and can be used or combined to achieve any particular dynamic quality on a page.

The DOM would be at least potentially well suited to this task in javascript but, when you say:

"this order also needs to be captured and submitted"

That gets me worried because, submission is generally a server side activity and javascript isn't secure for server side submission (if that is a concern, like in a sales environment) and cannot even work if the client doesn't have javascript enabled.

Even if you decide you would still like to try going this route, there would be some question in my mind as to whether or not reordering a table with form data in it using the DOM would appear to the browser and/or server as expected upon submission. There is a good chance that it would though, if things were well thought out.