[jQuery] Determine which table column was clicked
Hey all.
I have constructed some elaborate code on a db which I need to do some work
on, but there are a couple of problems getting in the way of business.
What I have is a very large table, and I wish to edit cells individually,
rather than create a textbox for each. I have something which allows for the
creation of select boxes when a cell is hovered over (mouseover), but what I
need to do next is quite complicated...
Because of the way the data is taken out of the db, I have had to dump a row
of text into a div, with each column seperated by a "//". This can then be
split into an array. Each array corresponds to a dropdown in the table.
For example, here is how my data is dumped into the div:
Florida,Texas,Washington//New York,Dallas,Orlando,Austin//Fast,slow,medium
In the table, there are three columns.
Column 1: States
Column 2: Cities
Column 3: Speeds
When column two is hovered over, I'm trying to get a select box to appear,
which shows the cities (split into 4 seperate options).
The problem is, how to determine which column is being hovered over and how
to link the select box to that particular column. The column name is NOT
hard-coded, so I can't set that in the code. Is there anything in JS (or
something readymade in jQuery ;)) which allows me to determine which table
column is being moused over, and therefore, which dimension in the db to
use?
Any help on this would be greatly appreciated.
Thanks in advance.
Dan Atkinson
--
View this message in context: http://www.nabble.com/Determine-which-table-column-was-clicked-tf2064756.html#a5688459
Sent from the JQuery forum at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/