When I call the loadData function, the sort order does not persist. Is there an easy way to do this? The data gets refreshed when I get an event from the database but I'd like to keep the grid where it was. It also looks like the grid is trying to persist the sort as the icon for the column sorted is still present, however, the data isn't updated to reflect that.
I fixed it with the below code, but I guess I'm curious why I had to do that, when the documentation for loadData says that it preserves the sort and filter?
$('#mamGrid').jsGrid("loadData").done(function () {
var sorting = $("#mamGrid").jsGrid("getSorting");
$("#mamGrid").jsGrid("sort", sorting);
});
Thanks! That works, and I'm really curious why it does not work when writing to the done() in the controller.
Most helpful comment
I fixed it with the below code, but I guess I'm curious why I had to do that, when the documentation for loadData says that it preserves the sort and filter?