reference to a cell or a row

reference to a cell or a row

jeansonjeanson Posts: 9Questions: 0Answers: 0
edited March 2010 in General
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 ?

Replies

  • pktmpktm Posts: 27Questions: 0Answers: 0
    Maybe you can use Events to handle this? cf. http://datatables.net/examples/advanced_init/events_pre_init.html

    hth, pktm
This discussion has been closed.