Satish Mehta

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromSatish Mehta
ToMe
SubjectNews on Dragable table cell enhancement
Date26 May 2007 13:21
Hi,

Your dragable script is very useful. But is this possible that the column
on which user dropped the dragged element gets highlight, so that user got
to know on which column dragged column gets dropped.

  I feel this will definately be useful functionality if once think from the
point of useability.

  thanks,

  Satish
FromMe
ToSatish Mehta
SubjectRe: News on Dragable table cell enhancement
Date27 May 2007 10:22
Satish,

> is this possible that the
> column on which user dropped the dragged element gets highlight, so
> that user got to know on which column dragged column gets dropped.

The script actually does not know what column (or row) the dragged cell was
dropped on. It only knows what column (or row) it was dropped before (based
on its top left corner), or if it was dropped at the end. That could mean
that it was dropped on that one, or the one before it, or nothing at all,
and the current script does not know which of those it was.

In particular, this would be very awkward to do for column sorting, since
HTML tables do not have the concept of columns. They have the COL element,
but that is extremely limited in terms of how it could be used for
highlights, and in fact, many current browsers cannot style it at all. In
addition, the script should not have to rely on there being any COL
elements.

So any highlight would have to be manually done by (after working out what
column you want to highlight), loop through all rows in the table, get the
cell in the desired column of each row based on its index, and set its
className to something to highlight it. Then you need some way to remove the
highlight again, so you would need to store the column information in a
global variable, and when they do something like trigger a mousedown on the
document, loop through them again and remove the className.

Then you would have to do something similar for the other possible
configurations - sorting rows, or sorting columns of a single row. And then
make sure that the highlight cleanup code knows which one was used last so
it cleans up the right version, even if a different version is used this
time.

This is all far too messy for a script that I wrote only to do a simple job,
so while it could be done, I do not want to add this functionality to the
script, though of course, you are welcome to add it yourself.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromSatish Mehta
ToMe
SubjectRe: News on Dragable table cell enhancement
Date28 May 2007 06:54
Hi,

  Actually from the script i am using only the column drg-drop functionality
that's why i required this enhancement. Anyways thanks for your reply on
this.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.