angulargrid icon indicating copy to clipboard operation
angulargrid copied to clipboard

Remove all items and load new ones

Open redhelling21 opened this issue 7 years ago • 1 comments

Hello, I searched in the issues and on the internet, but I can't find a solution to my problem... By clicking on a button (for example), i want to remove all the items from the grid, and then load new ones. I tried with a simple for loop made with splice and angularGridInstance.gallery.refresh, but even with #96 it does not work at all... Any ideas ?

redhelling21 avatar Apr 11 '17 13:04 redhelling21

Hello,

You can do the following to solve your issue,

initialize all variables before loading new items

$scope.card = {}; $scope.card.title = 'test'; $scope.page = 0; $scope.shots = []; $scope.loadingMore = false; $scope.totalImages = 0; $scope.totalPages = 1;

now call this ( your ) method

$scope.loadMoreShots();

krishnachhatbar avatar Jul 27 '17 11:07 krishnachhatbar