Preserve the state of tree grid (expand/collapse & scroll) on data source update
New DiscussionI am using igTreeGrid with AngularJs. In my scenario, data is being updated after X time interval. Issue is, on each data update, expand/collapse state doesn't preserve. It's reset to initial state. Also scroll position is also back to top. Here is the fiddle link: http://jsfiddle.net/tvsa5hwu/2/
Is there any way around to preserve tree grid state on data refresh?
//Below is the code which updates data source after 4scs. To show the issue,
//I am just copying the 1st item and re adding it with new id.
//Originally there will be some new data OR updates in existing data
$scope.counter = 1;
$interval(function() {
var duplicateItem = angular.copy($scope.dataSource[0]),
grid = $("#igniteGridId").data('igTreeGrid');
duplicateItem.name = "New node – " + $scope.counter++;
$scope.dataSource.push(duplicateItem);
if (!angular.equals(!$scope.dataSource, grid.options.dataSource)) {
grid.options.dataSource = $scope.dataSource;
grid.dataBind();
}
}, 4000);
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
12 Created On
Aug 24, 2016 Last Post
10 years, 1 month ago