Dynamic tbody isn't recognized by datatables
Dynamic tbody isn't recognized by datatables
Lone Shepherd
Posts: 11Questions: 0Answers: 0
I've got a page where I initialize a datatable object with a blank tbody. Then a jquery function calls an ajax form (with some params from controls on the page) to load data into tbody.
The content gets updated, but the rows are not styled. Also, when I click on any of the headers to sort, all the table data disappears and it shows the "empty table" text.
I'm not sure how to tell datatables that there is new content in the table. What's the best way to do this?
The content gets updated, but the rows are not styled. Also, when I click on any of the headers to sort, all the table data disappears and it shows the "empty table" text.
I'm not sure how to tell datatables that there is new content in the table. What's the best way to do this?
This discussion has been closed.
Replies
The reason for this requirement is that DataTables needs to be told about the new data so it can be processed and stored. It's not currently possible to put a DOM event listener on the table and see what new data is added (which would be the ideal way).
Allan
thanks for the timely response -- I must have missed that function when browsing the docs!
Nice plugin, by the way ;)