0

I'm using the datatable.net script on my site and I have a standard loaded table and everything works as expected.

I also have some additional query filters I use to re-load the table.

Something like this

$.get(ajaxurl, save_scope, function(response) {
        table.html(response);
        table.DataTable();
    });

The response loads correctly, but the DataTable() function doesn't seem to work at all on the newly loaded table. Is there some type of argument I need to pass that causes the DataTable script to re-apply itself on the page?

1 Answer 1

2

What error are you receiving?

Datatable() cannot be applied 2 times to the same table. One possible solution is first remove the table:

   //Delete the datable object first
   table.fnDestroy();

   //reload table content
   table.html(response);

   //create table object
   table.DataTable();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.