Datatable in modal - Accumulation of data

Datatable in modal - Accumulation of data

ferran_munozferran_munoz Posts: 28Questions: 7Answers: 0

Hello.

I have a modal that loads a datatable via Ajax every time that I push the button. But, when I open and then close the modal, If I push the button again, I see that the header columns has two times the sort icon. If I close and reopen again, three times, and so on.

For example, in this case, I did this four times:

So, when I close the modal I capture the event because I want to destroy the datatable. I used this: $('#table').dataTable().fnDestroy(); but it doesn't work and problem persist.

¿Any ideas?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • ferran_munozferran_munoz Posts: 28Questions: 7Answers: 0

    Hi Colin, glad to see you :smile:

    Well, I look for make an example via fiddle

  • ferran_munozferran_munoz Posts: 28Questions: 7Answers: 0

    Hi again!

    Don't worry Colin, I fix the problem. It was a DOM error, not datatable.

    Thanks!

  • idhardzlfkridhardzlfkr Posts: 1Questions: 0Answers: 0

    Hi ferran, i got this error right now. can i get to know, how could you solve it?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    @idhardzlfkr - if you can link to a test case, we're happy to take a look,

    Colin

This discussion has been closed.