Default behaviour in event

Default behaviour in event

lucas_araujolucas_araujo Posts: 10Questions: 3Answers: 0

Hi there!

I would like to know if there is a way to define a behaviour the dt will do on an event.

In my case, every page() event I want it to call

columns.adjust().draw()

so that the data is always nicely fitted (as the headers are breaking because of scrollY + paging), I know the usual method is dt.on... but it requires going on every DataTables defining this and i have A LOT dt's.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,143Questions: 26Answers: 4,918
    Answer ✓

    You could modify the datatables source code but you would need to make that modification anytime you upgrade. The page event is the best option. Possibility you can use a more generic selector like ‘table’ or ‘document’ instead of the specific table for the event handler.

    Kevin

Sign In or Register to comment.