PDA

View Full Version : drag and drop tut?


ethanton
03-26-2001, 04:56 PM
Hello,
Can anyone point me to a good drag and drop tutorial?
The project I'm working on will be for IE5, or 5.5...
I have found a few tutorials that involve text fields and images... I need to find a way to do it on rows in a table...
I have noticed that the <TR> tag will accept the ondrag event handler in IE --- but it seems you need to have the text in the row selected first. Is there a way to programatically select text (so the user can just click on the row..)
Thanks,
-E

kdjoergensen
03-27-2001, 02:34 PM
ondrag does not mean dragging an element. it means dragging the mouse with the button depressed. similar to what you are doing when you want to highlight some text in a word processor. ondrag will fire once you press the mousedown and then move it.
e.g.
events fired: onmousedown, onmousemove -> ondrag.

You can therefore also capture this 'event' in other browsers which does not support ondrag. capture onmousedown and then test for firings of onmousemove.

I am not sure what you want to do when you state: manually select text so the user can click on the row ?
are you after highlighting the text in a row across ?

If so you should looking into using the TextRange object. by selecting the TR element you can highlight the entire row.

Kenneth