Should footerCallback be called when clearing a search filter?

Should footerCallback be called when clearing a search filter?

wjenswjens Posts: 5Questions: 3Answers: 0

I have custom footer code displaying during the footerCallback but when I clear a search filter only the <tbody/> gets updated and there doesn't appear to be a footerCallback so my footer data is stale. Is there another callback for search filter clearing?

Answers

  • allanallan Posts: 61,969Questions: 1Answers: 10,160 Site admin

    If you call draw() then yes, the footer callback should be called. It is called everytime the table is redrawn.

    Allan

  • wjenswjens Posts: 5Questions: 3Answers: 0

    I don't think I was clear. My footerCallback is not being called when someone clears their search criteria using Datatables built-in search field. I'm not programmatically doing anything with search, just trying to show sum/counts in the footer.

    I don't mind calling draw() manually but what do I need to hook into in order to know when the search field has been cleared. This feels like a bug.

  • kthorngrenkthorngren Posts: 20,420Questions: 26Answers: 4,794

    This example seems to work when clearing the builtin search field:
    https://datatables.net/examples/advanced_init/footer_callback.html

    Can you post an example showing the issue?

    Kevin

This discussion has been closed.