Forum Moderators: open

Message Too Old, No Replies

holding current table selections

         

natty

4:49 pm on Jun 29, 2004 (gmt 0)

10+ Year Member



hi all,

me again, with more tabular report action.

i have a function that when a row(or sometimes just a cell) on a report is selected it fills another frame with what is currently selected.

atm the way i have done this is to pass the function a load of args, basically what is is every cell, and some other hidden stuff. the function call is generated by the asp.

i want to rewrite this. as its a tad messy, and also there are different reports with different columns, in different orders, all wanting to fill this current selection frame.

is it possible to , after passing a td(tr) obj to my function, to work out what the column heading is without having to traverse my way up the document tree? from there i could find out the column headings and put the correct values in the correct place.
i guess i could parent my way to the top and then work my way through the th's.

or maybe that is a stupid idea?!?!

anyone have a better idea?

tia

Bernard Marx

4:58 pm on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If understand correctly, and there isn't any confusion introduced by having colspan cells on the rows in question or the heading..

- Give the header row an id
- Get the cell's cellIndex.

So

var colHeader = document.getElementById("_headerRowID_").cells[cellRef.cellIndex]