Redraw different dataTable after updating other
Redraw different dataTable after updating other
dougguthrie
Posts: 10Questions: 7Answers: 0
I have two datatables on one page. After updating one I would like to see the results also appear in the second one. Is this possible?
I've been playing around with the draw() method as well as drawCallback. I'm not sure if I'm on the right track.
Code example below:
constraintEditor = new $.fn.dataTable.Editor( {
ajax: {
edit: {
url: "/clients/aps/update",
type: "PUT",
data: function (d) {
return JSON.stringify(d);
},
drawCallback: function ( settings ) {
accountTable.draw();
}
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It depends a little on your configuration - for example are your table's Ajax loaded, server-side processing or something else? If you can't link to a test case showing the issue, can you use the debugger to give us a trace?
In the most common case, if you want to update a second table once another has been updated, use
ajax.reload()
inside an EditorsubmitComplete
event handler - e.g.Allan
My table is ajax loaded and this example fit my situation perfectly. Thank you again for your help!