Dynamic event binding not firing

Cracker0dks

I want to bind a tr click event to my datatable.

This is my code now:

$(myDataTable).find("tbody tr").on("click", function (e) {
//do the magic
});

It works for the first page. On second page i got no click event.

.live and .delegate also not work.

Anyone with a solution and can say why this is not working? I would prefer not to use the dataTables render callbacks.

Pranav C Balan

To work with dynamic element use the following code

$(myDataTable).on("click","tbody tr", function (e) {
//do the magic
});

Documentation : http://api.jquery.com/on/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related