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

totalServerUnits separated from pageInfo #161

Closed
keithharvey opened this issue Feb 14, 2013 · 3 comments
Closed

totalServerUnits separated from pageInfo #161

keithharvey opened this issue Feb 14, 2013 · 3 comments

Comments

@keithharvey
Copy link

I currently have a standardized paging query I get from an angular service which is used to bind ng-grid's page info/filter info to. $scope.nav = navSvc.getPageQuery() and then I $watch that object for changes and post when currentPage changes, a filter is added, etc.

This arrangement seems intuitive to me and I'd like to make it work. The only problem with this approach (apart from the sortInfo bug) is that whenever I get the data back from the server I'd like to update the total server items. This triggers the $watch. I could work around this inside the $watch with some comparison logic, but wouldn't totalServerItems be better left outside of the pageInfo object since any external paging wouldn't need it?

@orneryd
Copy link
Contributor

orneryd commented Feb 18, 2013

you shouldn't have to watch the entire object though. you should be able to just watch the items you need.

but just to explain our original reasoning, we chose to add hierarchical options for server-side paging and filtering because they are pretty isolated to specific use-cases and we didn't want to clutter up the base grid options with irrelevant options.

I would rather not make a change to the existing options that could break other user's existing implementations. If you could give me a plunker I think I know if a simpler way to solve your problem from reading it.

@keithharvey
Copy link
Author

orneryd added a commit that referenced this issue Apr 2, 2013
@orneryd
Copy link
Contributor

orneryd commented Apr 2, 2013

I think this makes sense to change since then you can watch the object by itself since the totalServerItems is really not used for querying and only display.

this is changed in 847d13e and will be in 2.1 main release.

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

No branches or pull requests

2 participants