jQuery Datatables.net plugin - how to set table's data?
Say I use the following to initialize my table: http://www.datatables.net/release-datatables/examples/data_sources/server_side.html. How do I later on change the data in the table?
I need to update the table for a number of reasons (e.g. new data is added, data is deleted, data is updated, data is sorted, etc.). I have methods to do all those, I'm just not sure how to make the tabl开发者_StackOverflow中文版e reflect the new data once I get it.
Since you are using server-side processing, once the server has the new data, all you need to do is call fnDraw ( http://datatables.net/api#fnDraw ) on your table. That will cause it to make another XHR to the server to get the latest data and draw it.
精彩评论