0

With jQuery DataTables, a table automatically shows the message, "No data available in table" if it is empty on loading.

I am using AJAX to delete some rows, and it may be that the table is emptied this way.

How can I set this "no data" message, when using jQuery .remove(), when the last row is removed from the data table?

Or should I be using an AJAX source for the table, and somehow recall the new data after doing a delete, to repopulate the table?

1 Answer 1

1

Calling reload method in datatable plugin API will do it automatically for you

refer the following link to know how to reload the datatable

https://datatables.net/reference/api/ajax.reload()

Sign up to request clarification or add additional context in comments.

6 Comments

Thought as much! Time to change all my table to AJAX sources :D
what type of binding are you using now to populate the data ?
Just looping through an object and outputting it to the DOM
Yes. But I will change it to use the AJAX source.
yeh that will be good because we just give the data to the plugin and they will do all other things. less work for programmer :)
|

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.