knockout and datatable stop working after sorting
knockout and datatable stop working after sorting
kenneth_eagle
Posts: 2Questions: 0Answers: 0
I found an interesting behavior with the knockout prototype, http://datatables.net/dev/knockout/.
The prototype stop working after re-sort the table. I used setTimeout for updating a field after 5 sec. Within that 5 sec time range, I sort the table to a different order, then field won't get updated. Does anyone experiencing the same problem?
The prototype stop working after re-sort the table. I used setTimeout for updating a field after 5 sec. Within that 5 sec time range, I sort the table to a different order, then field won't get updated. Does anyone experiencing the same problem?
This discussion has been closed.
Replies
$.each(this, function (key, value) {
self[key].subscribe(function (val) {
// Find the row in the DataTable and invalidate it, which will cause DataTables to re-read the data
//var rowIdx = dt.column(0).data().indexOf(self.Id());
//dt.row(rowIdx).invalidate();
// set all rows invalidate
dt.rows().invalidate();
});
});
I've been working on a `dt-foreach` binding which might be a bit more intuitive with Knockout rather than the horrendous mess of the observable arrays and objects.
Could you drop me a message ( http://datatables.net/contact ) with your e-mail address if you are interested in taking an early look at it?
Allan