how to stop and restart datatables?

how to stop and restart datatables?

bonnerbonner Posts: 4Questions: 0Answers: 0
edited December 2013 in General
I'm trying to transform a row of my table in a form by clicking a button. My problem is the table uses Datatables plugin, and I would like to disable the script (filtering, sorting ecc.), and reactivate it after submit.

I was trying now to use bDestroy while starting a new istance with filtering and sorting disabled, but I would like to totally disable the script, because it might create new issues to my script.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Use fnDestroy to destroy a DataTable completely.

    Allan
  • bonnerbonner Posts: 4Questions: 0Answers: 0
    thanks that's exactly what I needed! One issue I have now is every time I destroy and reinitialize again Datatable the table is getting smaller in its width. Can you guess why and how could I fix that?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    No idea why that would be. Can you link to the page please.

    Allan
  • bonnerbonner Posts: 4Questions: 0Answers: 0
    edited December 2013
    It is running on my computer with xampp. Anyway I've tried to launch my functions on the table without datatables and the width is always the same, it happens only when destroying and launching again datatables. The filtering field and the pagination are still in their position, but only the table is getting thinner every time like 5-6 pixels less
  • bonnerbonner Posts: 4Questions: 0Answers: 0
    if i repeat that several time can see that the sortable columns are getting each time thinner, and the only one unsortable is getting wider, but in the complex the whole table is thinner
This discussion has been closed.