dataTables loses event after page 1

dataTables loses event after page 1

seowayseoway Posts: 1Questions: 0Answers: 0
edited July 2013 in General
Hi there,

I try to understand how to apply event recalling.
I'd like to have this:

// name=modal is called by javascript to display window with included file.

On every page, not just the first one. I must say, that FAQ:Events doesn't say much to me.

I'm using:
js/morris/morris.min.js
js/modal-window/custom.js

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    I am not sure if understand you correctly, but if you added events to the actual or : these get lost after moving to the next page, as the and are re-rendered.

    So you could hook to fnDrawCallback like this

    [code]
    "fnDrawCallback": function(oSettings) {
    $myTableElement.find('tr').each(function() {
    var tr_element = jQuery(this);
    tr_element.unbind('click.datatable_onTableRedraw');
    tr_element.bind('click.datatable_onTableRedraw', function(e) {
    //my stuff here
    });
    });
    }
    [/code]
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    The top FAQ might help: http://datatables.net/faqs#events .

    Allan
This discussion has been closed.