Open amergin opened 7 years ago
The way I've forced the layout algorithm to retrigger is using the following code snippet:
var temp = $scope.items;
$scope.items = [];
$timeout(function() {
$scope.items = temp;
});
which utilizes the fact that any updates to $scope.items
will trigger a $digest
cycle to occur. The $timeout
call with no time specified ensures that the $digest
cycle is triggered before the reset of items.
Is it possible to force the layout algorithm to retrigger? I asked in https://github.com/ManifestWebDesign/angular-gridster/issues/458 whether it's possible to toggle the visibility of the items. As a continuation, it would be ideal to retrigger the layout algorithm to rearrange the items in the grid to take up the space freed from the hidden items.