| Author |
select a row in table
|
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
|
|
I have a table whose rows are dynamically added...
I want to select any row and listen to that row... how to do this in Javascript?
I get the table body this way...
Now what should be done??
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
How is the user selecting the row? SOunds like you need a checkbox and/or onclick.
Eric
|
 |
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
|
|
yes Eric...my intent is to select using click since I was denied using checkbox as per requirements...
but the problem is inside the javascript...
I create a row as...
row=document.getElementById("TR");
So am always getting the current row and unable to track the previously added rows...
How to get all previously added rows and move the mouse over my table and click a row and listen to onclick??
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
|
If you establish a click handler for each row, the TR element upon which you click will be available in the Event instance passed to the handler.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: select a row in table
|
|
|