开发者

how to rebind array to dataTables.net grid

开发者 https://www.devze.com 2022-12-19 04:19 出处:网络
I am using dataTables.net jquery grid to display data in html table. I cou开发者_JAVA技巧ldn\'t find a method to set the array as datasource dynamically and rebind the grid.

I am using dataTables.net jquery grid to display data in html table. I cou开发者_JAVA技巧ldn't find a method to set the array as datasource dynamically and rebind the grid.

Please let me know.


You can update the datatable by calling fnDraw() method. However the Datatables will read the data again from the actual data source (Ajax URI, in your case) ONLY if bServerSide: true is set (by which you are telling the Datatables that all the processing is done at server side).

One side effect of bServerSide: true is that you need send the pagination details (iTotalRecords & iTotalDisplayRecords, .. ) & other data in the Ajax response (see Server-side Processing docs).

Othre side effect is that filtering will not work any longer :( Datatable can't filter the partial data which it has.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号