Skip to content

Commit 391b206

Browse files
gabmedradcortez
authored andcommitted
Update person.js
Watch the whole sortInfo variable not only fields. That way it catches sort directions refreshing too Reset list to page 1 after changes on SortInfo
1 parent 8533d8b commit 391b206

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/webapp/script/person.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ app.controller('personsListController', function ($scope, $rootScope, personServ
4848

4949
// Watch the sortInfo variable. If changes are detected than we need to refresh the grid.
5050
// This also works for the first page access, since we assign the initial sorting in the initialize section.
51-
$scope.$watch('sortInfo.fields[0]', function () {
51+
$scope.$watch('sortInfo', function () {
52+
$scope.persons = {currentPage: 1};
5253
$scope.refreshGrid();
5354
}, true);
5455

0 commit comments

Comments
 (0)