reference to a cell or a row
reference to a cell or a row
Hi everybody,
I have a problem with referecning a cell or a row.
I try to explain my problem :
When I click on a row of the table, I put it on a row_selected class and i add a button on the page.
When clicking on that created button, i would like to keep the reference of the row I clicked on in the table.
I don't know if I'm clear enough so I give a piece of the code :
[code]
$('#the_table tr)').bind("click", function () {
$(this).addClass('row_selected');
$('#switcher-RE').html('');
$("#boutonRE").bind("click", function(){
// I would like here to get reference to the row I click first on the first line of this code
// because I want to put this row, for example, with a red background
}
[/code]
I tried $(this) but it is, at this point, referncing to the button (#boutonRE) no to the clicked row anymore.
Could someone help me, please ?
I have a problem with referecning a cell or a row.
I try to explain my problem :
When I click on a row of the table, I put it on a row_selected class and i add a button on the page.
When clicking on that created button, i would like to keep the reference of the row I clicked on in the table.
I don't know if I'm clear enough so I give a piece of the code :
[code]
$('#the_table tr)').bind("click", function () {
$(this).addClass('row_selected');
$('#switcher-RE').html('');
$("#boutonRE").bind("click", function(){
// I would like here to get reference to the row I click first on the first line of this code
// because I want to put this row, for example, with a red background
}
[/code]
I tried $(this) but it is, at this point, referncing to the button (#boutonRE) no to the clicked row anymore.
Could someone help me, please ?
This discussion has been closed.
Replies
hth, pktm