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

What the hell is going on with the paging "totalServerOptions"?! #504

Closed
Siyfion opened this issue Jun 24, 2013 · 8 comments
Closed

What the hell is going on with the paging "totalServerOptions"?! #504

Siyfion opened this issue Jun 24, 2013 · 8 comments

Comments

@Siyfion
Copy link

Siyfion commented Jun 24, 2013

I think there's a lot of confusion about what people are meant to be using regarding the totalServerOptions variable when using server-side paging.

I now no-longer know whether I should be setting:

$scope.gridOptions.totalServerItems = data.count
or
$scope.gridOptions.pagingOptions.totalServerItems = data.count

If it's the latter, then a load of functions need to be modified in /src/classes/footer.js as they all refer to $scope.totalServerItems. If it's the first option, then it doesn't currently work (getting "null" constantly).

@Siyfion
Copy link
Author

Siyfion commented Jun 24, 2013

Pull request #505 fixes this, if the documentation is the correct way to do things.

@jonricaurte
Copy link
Contributor

You should be using the $scope.gridOptions.totalServerItems = data.count

Just made a plunker for it: http://plnkr.co/edit/50vJrs?p=preview

I will update the documentation when I get back. Sorry about that.

@Siyfion
Copy link
Author

Siyfion commented Jun 28, 2013

In which case, can we have the "null items" bug fixed please?

@jonricaurte
Copy link
Contributor

Yes, I am going to update it in the 2.0.7 pull request when I get back. The null was only happening if you weren't using a string for the totalServerItems and did not explicitly set gridOptions.totalServerItems. The maxRows function in footer returns the math.max, but if totalServerItems was undefined, the number returned would be a NaN

@jonricaurte jonricaurte reopened this Jun 28, 2013
@jonricaurte
Copy link
Contributor

Will leave open until it is updated.

@Siyfion
Copy link
Author

Siyfion commented Jun 28, 2013

Hmm.. I am explicitly setting totalServerItems (not on startup however), but I'm still seeing null values after its been set!

That ,and being able to go to page 2 when there's less than 1 page worth to begin with.

@jonricaurte
Copy link
Contributor

Can you show it in a plunker?

@jonricaurte
Copy link
Contributor

Now I know why they were split. "we switched out the place where totalServerItems is set because people
wanted to update it manually while watching the pagingOptions configuration
variable for changes (so they know when to retrieve more data from the
server)." from #332. You need to use totalServerItems: 'totalServerItems' in grid config so it is watched. You can only set totalServerItems if you use a string reference. I am going to update the documentation. Try the latest version of 2.0.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants