Whats the best way to rebind using datatable?

Whats the best way to rebind using datatable?

rajeshu2484rajeshu2484 Posts: 8Questions: 2Answers: 0

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

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    What do you mean by "rebind"? Are you using some sort of data binding framework?

    Allan

  • rajeshu2484rajeshu2484 Posts: 8Questions: 2Answers: 0

    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?

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin
    Answer ✓

    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

This discussion has been closed.