Whats the best way to rebind using datatable?
Whats the best way to rebind using datatable?
I'm using datatables 1.10. My code runs on a device hence we use file:/// protocol too load the app. No http server! Initially the grid loads with no data. I get one record at a time from backend and I have to rebind grid everytime. I'm able to get it working by re-initialzing the table. But whenever I rebind the sorting goes back to default sort setting. Whats the best way to rebind data which will preserve sort? Using ajax option gives me cross origin error.
This question has an accepted answers - jump to answer
Answers
What do you mean by "rebind"? Are you using some sort of data binding framework?
Allan
Yeah we have written a wrapper around datagrid. But my question is generic. What I meant is how do we add a row to datagrid without re initializing the whole grid?
Use
row.add()
. The full searchable list of API methods is available here.Allan