Data Table custom widget current page number binding

1
0
-1

Hello,
I created a data table custom widget and I need to get a current page number in order to use Identity API such as

../API/identity/user?p={{currentPage}}&c=10&o=lastname%20ASC&f=enabled%3dtrue

I could get the current page number inside widget like
{{ctrl.pagination.currentPage}}

I created a Bidirectional bond property to link together.
However, I dont get the right result.
I would appreciate if someone gives me an idea.

Thanks in advance

this.isChangagle = function () {
return $scope.properties.isBound('currentPage');
};

this.updateResultsFromJson = function () {
$scope.properties.currentPage = vm.pagination.currentPage;
var start = (vm.pagination.currentPage - 1) * $scope.properties.pageSize;
var end = vm.pagination.currentPage * $scope.properties.pageSize;
vm.results = vm.jsonData.slice(start, end);
this.isChangagle();
};

No answers yet.
Notifications