How to restore datatable events

How to restore datatable events

frankgfrankg Posts: 3Questions: 1Answers: 0

Hi there,
we are using the datatables plug-in in a single page application where we have build our own history functionality.
After doing a history.back to a side with a datatables plug-in the table still looks fine but all datatable events are lost.
Is there a way to set all required datatable events once again?
Thanks in advance, best regards, Frank.

Answers

  • allanallan Posts: 63,745Questions: 1Answers: 10,509 Site admin

    Events as in draw? If your custom listeners have been removed, they would need to be readded.

    Allan

  • frankgfrankg Posts: 3Questions: 1Answers: 0
    edited September 2015

    Hi Allan,
    thanks for your reply.
    Not my custom listeners are missing, all the default listener of the datatables pug-in itself are missing.
    I'm looking for a way to restore all datatables events. In principle the opposite of the Methode destroy().

    Frank.

  • allanallan Posts: 63,745Questions: 1Answers: 10,509 Site admin

    That would be a reinitialisation of the table $(...).DataTable().

    Can you link to a page showing the issue?

    Allan

  • frankgfrankg Posts: 3Questions: 1Answers: 0

    Unfortunately not, because it is a local application.
    A reinitialisation is for several reasons not possible.
    I was hopful that there is a way the set only the datatables events.
    The rest is working fine (html, css). Just the datatable Events are missing.

  • allanallan Posts: 63,745Questions: 1Answers: 10,509 Site admin

    I don't really understand how it would get into that state I'm afraid. Does that happen in all browsers? I don't know why it would retain all its functionality minus the event listeners. There is no simple method to tel DataTables to add its event listeners again since that is a very unexpected state to be in.

    Allan

This discussion has been closed.