Tom
Tom

Reputation: 1607

Jquery datatables callback on search

I'm using Jquery datatables plugin to generate my tables. In every row I have a button to open the child data. The button has the class "fa-plus". To trigger this I use a simple Jquery on click function.

fnDrawCallback: function() {
      $('.fa-plus').click(function() {
           // some functionality
      });
},

This work great only even if you go to the next page it works as the function is reloaled with the fnDrawCallback callback. Only when you use the search option in the dattatables the callback is not triggered. Also not with the fnInfoCallback function.

Does anyone know if there is an callback on the search function of Jequery datatables?

I'm looking for a callback that is triggered on any change of datatables.

Upvotes: 2

Views: 5881

Answers (1)

Brian Kates
Brian Kates

Reputation: 488

You can look at Datatable events

e.g.

$('#table').on('search.dt', function (e, settings) {
    // ...
});

Does that help?

Upvotes: 5

Related Questions