...

View Full Version : sorting problem : drag & drop items in a combo box



shibby1011ph
03-24-2005, 08:11 AM
i have a combo box filled with employee names. the user can select a name and physically move that name to the top of the list. so i guess, i would have to use dhtml. but i don't know where to begin. in the meantime, i made 2 buttons, up and down, with respective functions. can anybody give me any idea how to go about this dilemma? i'm a bit familiar with layers, divs, spans but i don't have a clue on the ff :

1) how to position a layer in the exact place where the user selected a name.
2) manipulate the layer's text field. i will keep on replacing the employee name in the layer's text field.

given this code :
function manualSort(personList){
var personName = personList.options[personList.selectedIndex].value;
///-----after this i don't know what to do next
}
<select name="personList" multiple onclick="manualSort(document.myForm.personList);">
blah blah
</select>


pls help!

Kor
03-24-2005, 10:49 AM
well, it depends on how intricate you wanna that application to be... drag'n'drop codes are quite complex... Do you really need that? You may use instead some buttons to choose / place / move up / move down, which means a little bit simplier code (mainly basic DOM methods)

shibby1011ph
03-25-2005, 12:12 AM
You may use instead some buttons to choose / place / move up / move down, which means a little bit simplier code (mainly basic DOM methods)

i already made that move up and down buttons for temporary use. i was hoping to enhance it , make it very very user friendly :)

Vladdy
03-25-2005, 12:42 AM
Here is a drag and drop sorting code applied for a somewhat different application:
http://webdeveloper.klproductions.com/demos/arrangetextquizdemo.html

shibby1011ph
03-25-2005, 07:15 AM
@ Vladdy : now that was COOL! :cool:

thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum