Tell datatables data in a plain html table has updated
Tell datatables data in a plain html table has updated
ssloan
Posts: 4Questions: 0Answers: 0
Hi there,
I've already got a fairly complex html table setup, that I update through ajax calls based on user interactions with buttons etc. I've used dataTables to enhance the table, but it doesn't seem to pickup updates to the data for sorting.
I'm initialising the table like this
[code]
$("#studentListTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
]
});
[/code]
I then want to be able to update the contents of table cells in the dom and have it use the new values for sorting. I've tried calling [code]fnDraw()[/code] afterwards but that didn't make any difference. Are there any methods I can use for this or do I need to integrate the ajax calls with the data tables ajax api?
Thanks.
I've already got a fairly complex html table setup, that I update through ajax calls based on user interactions with buttons etc. I've used dataTables to enhance the table, but it doesn't seem to pickup updates to the data for sorting.
I'm initialising the table like this
[code]
$("#studentListTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
]
});
[/code]
I then want to be able to update the contents of table cells in the dom and have it use the new values for sorting. I've tried calling [code]fnDraw()[/code] afterwards but that didn't make any difference. Are there any methods I can use for this or do I need to integrate the ajax calls with the data tables ajax api?
Thanks.
This discussion has been closed.
Replies
This. There is no DOM mutation API DataTables can listen for (at least not a stable one in all browsers) so you must use the API - http://datatables.net/faqs#append
Allan