aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes What Row am I on? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "What Row am I on?" Watch "What Row am I on?" New topic
Author

What Row am I on?

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
If I use JSPL to fill in a table and I give each row a unique id. If I click in a cell is there a way to tell what the row id is?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Easiest solution is to add onclick handler to the cell.

<td id="foo" onclick="alert(this.id)">

Eric
[ September 27, 2007: Message edited by: Eric Pascarello ]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
My idea is to have a checkbox in the first column. If it is clicked I want to turn that row yellow. If unchecked turn it back to white. Can you help me with this.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are lucky I am waiting on a build:



Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
Thanks a lot. Due lack of knowledge I was trying to complicate it too much.
I hope you have time for one more issue. I need the contents of each cell on the row when I click the checkbox. Can this be done?
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
Hey, I figured it out. Again I was using to much code to try an qualify the cell.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just for kicks


Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What Row am I on?