This topic contains 1 reply, has 2 voices, and was last updated by Jai Jai 8 months, 1 week ago.

mDataTable.destroy() behavior

  • arvid

    Posts: 2
    Member Reply #17815


    I’m using mDataTable with local data. When I want to update the dataset I use destroy() and create a new datatable at its place.
    There are two things sometimes run into:

    1. destroy() seems to delete its parent container, so initialising again with <div id="myTablePlaceholder" /> and $('#myTablePlaceholder').mDatatable(options); is then impossible. Can you confirm if this is the desired behavior?
    2. When you navigate via pagination to the end, but load less data, the state seems corrupt. Does destroy() make sure (localStorage) state is reset?



    Posts: 2700
    Support Staff Reply #18171

    Hi 🙂

    mDatatable destroy method revert the state of the container element. Please check the sample code here;


    currently destroy method does not reset localStorage state. We will fix it.


You must be logged in to reply to this topic.