processing.dt event not Bubbling

processing.dt event not Bubbling

rodriformigarodriformiga Posts: 47Questions: 12Answers: 0

Dear @allan,
I am upgrading from DataTables 1.10.21 to 2.1.7 and refactoring some customizations I did. One of then I use $(document).on("processing.dt", function(){...}) to do some global things to all my dataTables.

In 2.1.7 this dont work anymore, it only work if I attach the event directly to the table like $("#myTab").on("processing.dt", function(){...}). The other events like draw, xhr, etc are working fine. Only this one is not bubling up.
So, I think it is a bug.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Not a bug, it doesn't bubble (that property doesn't actually appear on the rendered doc page, I'll fix that).

    The event bubbling can slow things down, so I limited it to just specific events. I can consider adding it here as well - what's the use case that you can't add it to the DataTable instance?

    Allan

  • rodriformigarodriformiga Posts: 47Questions: 12Answers: 0

    Hi @allan
    Understood. I didn't know the documentation on git yet. It will help me a lot to migrate from version 1.10 to 2.1. Thanks.

    In my case, I created the event at the document level to use a processing indicator that is already standard in my system (jSpinner) instead of the default DataTable indicator.
    In any case, I can find a better way to do this, such as attaching the event to the DataTable instance in the preInit event.

Sign In or Register to comment.