Changing page or length of the table
Changing page or length of the table
I'm fairly new with DataTables, please bear with me :)
My table has links in some of the table cells. I catch clicks on them and do some stuff:
[code]
$('a.test').click( function () {
console.log("clicked");
});
[/code]
Everything is good until I change the length of the table or go to the next page.
The links in rows which weren't originally displayed in the first page can't be captured with jQuery anymore.
Looking into the html with firebug everything looks ok, the rows and links are there, but they can't be selected.
I must be missing some very basic here...
Does something need to be refreshed or reloaded when pagination or length of the table gets changed?
Thank you in advance!
My table has links in some of the table cells. I catch clicks on them and do some stuff:
[code]
$('a.test').click( function () {
console.log("clicked");
});
[/code]
Everything is good until I change the length of the table or go to the next page.
The links in rows which weren't originally displayed in the first page can't be captured with jQuery anymore.
Looking into the html with firebug everything looks ok, the rows and links are there, but they can't be selected.
I must be missing some very basic here...
Does something need to be refreshed or reloaded when pagination or length of the table gets changed?
Thank you in advance!
This discussion has been closed.
Replies
$('a.test').live('click', function() {
console.log("clicked");
});
sorry for the off topic, it's pretty basic jQuery stuff after all
[code]
$('tbody').on( 'click', 'a.test', function () {
...
} );
[/code]
for example. `live` is decremented in the jQuery API. I'll be updated the FAQs and all examples on this site soon.
Allan