Events not working after pagination

Events not working after pagination

OBCENEIKONOBCENEIKON Posts: 9Questions: 0Answers: 0
edited January 2014 in General
My event handlers are being lost after going to the next page of results. I have tried to use both "on" and "delegate."
[code]$('input[type="checkbox"]').on('change', function() {[/code]
[code]$('tr').delegate('input[type="checkbox"]', 'change', function() {[/code]

Here is a link to a fiddle.
http://jsfiddle.net/AapFe/

I've gotta be missing something really obvious here, I think I have been looking at this code for too long.

Replies

  • OBCENEIKONOBCENEIKON Posts: 9Questions: 0Answers: 0
    Check or uncheck any of the boxes and the save button should become enabled. Go to the next page and do the same, the save button will not enable.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Top FAQ: http://datatables.net/faqs#events :-)

    Allan
  • OBCENEIKONOBCENEIKON Posts: 9Questions: 0Answers: 0
    Thanks Allan. Like I said, I had to be missing something really obvious. I read those three pages so many times.

    Live events / Pre-init / Post-init

    http://datatables.net/release-datatables/examples/advanced_init/events_live.html
    http://datatables.net/release-datatables/examples/advanced_init/events_pre_init.html
    http://datatables.net/release-datatables/examples/advanced_init/events_post_init.html
This discussion has been closed.