I have some problems loading the saved state of the grid in Angular.
This is the grids HTML:
<div id="grid" kendo-grid k-options="GridOptions" k-ng-delay="GridOptions"></div>
Later I start my Http call and the $scope.GridOptions are filled in and the grid works fine.
Then I save the state of my grid this way:
$scope.GridOptionsBackup = kendo.stringify($scope.GridOptions);
This works fine and when i print the output in the console. It looks like this:
{"dataSource":{"schema":{"data":"Data"},"transport":{},"serverSorting":true,"table":null,"fields":[{"encoded":true,"field":"WidgetName","title":"Name","template":"#: data.WidgetName#"},{"encoded":true,"field":"WidgetDescription","title":"Description","template":"#: data.WidgetDescription#"}]},"columns":[{"field":"WidgetName","title":"Name","template":"#: data.WidgetName#"},{"field":"WidgetDescription","title":"Description","template":"#: data.WidgetDescription#"}],"sortable":{"mode":"multiple","allowUnsort":true},"scrollable":true}
When i try to reload the grid with the saved state, i read the JSON, parse it and reassign it to $scope.GridOptions. But this don't work:
$scope.GridOptions = JSON.parse($scope.GridOptionsBackup);
Why is the grid not updated after this line of code?
I really appreciate any help you can provide!