Why some events are not whorking after page changes? -EDITED-

Why some events are not whorking after page changes? -EDITED-

kakebukekakebuke Posts: 2Questions: 0Answers: 0
edited August 2010 in General
So sorry, forgot to read FAQ.....

Excuse me.. :(



Hi Everybody

First of all, thanks for the great job done with dataTables.

Second: i'm not a javascript expert, so if what i'm asking is so easy, please, dont laugh :)

The question: i have a dataTable initialised, and inside of it i have a link which has a confirm dialog attached via something like that:

[code] $('.delete').click( function() {
answer = confirm('Confirm that');
return answer;
}) [/code]

Ok, my problem is that it works out of the box for every .delete link on the first page of my fabulous dataTable, but when i change the page, it won't show anything. I had been thinking that this may be becouse the DOM changes every time you go to a new page, so i tried to bind it inside fnDrawCallback, but still this doesn't work.

I've tried several things and none worked... so i thought: "ask the community!". And here i am.

Thank you everybody in advance.

Replies

  • kkudikkudi Posts: 77Questions: 0Answers: 0
    try $('.delete').live instead of click.
  • kakebukekakebuke Posts: 2Questions: 0Answers: 0
    Hi kkudi:

    Thanks for the quick answer, but i found what i was looking for in the FAQ. I have to punish myself for not reading the Forum rules before posting...

    Thanks anyway!

    Great job done here, allan!!!
This discussion has been closed.