This brings up an interesting thought, instead of using a function before draw to go back and loop through to add the click event, it seems that using a live binder to the column would be simpler and possibly less overhead.
when i have many rows, and if i click on the "next" button to display following rows, it still works, but when i click on "previous" the livequery stops working.
I switch from livequery plugin to native live :
[code]
$('#example tbody td:first-child').live('click', function() {
$('#idselect').val(this.innerHTML);
});
Replies
Regards,
Allan
It seems that the :
[code]$('#example2 tbody td').click( function () [/code]
is not catched for an ajax source, that one is catched :
[code]
$('#example2 thead th').click( function () {
alert ('click');
} );
[/code]
Regards,
Lionel.
I have found a way to do so, using the livequey plugin :
Actually i needed to get the value of all first TD when clicking on them :
[code]
$('#example2 tbody td:first-child').livequery('click', function(event) {
$('#idselect2').val(this.innerHTML);
} );
[/code]
Regards
Do I understand this correctly?
Thanks,
Patrick
Another option is to use fnGetNodes() ( http://datatables.net/examples/advanced_init/events_post_init.html ). And possibly fnDrawCallback.
Allan
when i have many rows, and if i click on the "next" button to display following rows, it still works, but when i click on "previous" the livequery stops working.
Regards.
I switch from livequery plugin to native live :
[code]
$('#example tbody td:first-child').live('click', function() {
$('#idselect').val(this.innerHTML);
});
$('#example tbody td:first-child').live('mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
$(this).addClass('dessus');
} else {
$(this).removeClass('dessus');
}
});
[/code]