Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broking pagination if resource.pagination is missing #68

Closed
Zizzamia opened this issue Dec 17, 2014 · 0 comments
Closed

Broking pagination if resource.pagination is missing #68

Zizzamia opened this issue Dec 17, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@Zizzamia
Copy link
Owner

If resource.pagination is missing in the Table server side the pagination is broke.
Possible fix

$scope.rows = resource.rows;
if ($scope.paginationDirective) {
      $scope.pagination.page = $scope.params.page;
      $scope.pagination.count = $scope.params.count;
      $scope.pagination.size = $scope.rows.length;
      if (resource.pagination) {
        if (resource.pagination.count) {
          $scope.pagination.count = resource.pagination.count;
        }
        if (resource.pagination.page) {
          $scope.pagination.page = resource.pagination.page;
        }
        if (resource.pagination.size) {
          $scope.pagination.size = resource.pagination.size;
        }
      }
      $scope.pagination.pages = Math.ceil($scope.pagination.size / $scope.pagination.count);
    }
@Zizzamia Zizzamia added the bug label Dec 17, 2014
@Zizzamia Zizzamia self-assigned this Dec 17, 2014
@Zizzamia Zizzamia added this to the Version 0.4.2 milestone Dec 17, 2014
Zizzamia pushed a commit that referenced this issue Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant