I have an Angular single page app with a kendo grid that is bound to a RESTful API. When this data is updated externally, I have a web socket (PubNub) function I am triggering with the intent to refresh and display externally changed data while preserving the hierarchy of the grid as well as selected row.
I can get the data grid to refresh but this doesn't refresh the datasource with the changed data from the API. If I include a dataSource.read(), then it seems to prevent my persistence of the hierarchy, IE it closes previously opened hierarchical grids.
I have an tried to use the example from the Telerik Docs for this listed here: Persist expanded rows after refresh
vm.savestate = function(e) {
console.log('save pressed:');
var grid = $scope.responseGrid;
var expanded = $.map(grid.tbody.children(":has(> .k-hierarchy-cell .k-minus)"), function(row) {
console.log(row);
console.log($(row).data("uid"));
return $(row).data("uid");
});
grid.one("dataBound", function() {
grid.expandRow(grid.tbody.children().filter(function(idx, row) {
return $.inArray($(row).data("uid"), expanded) >= 0;
}));
});
grid.refresh();
};