-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Total Items in footer issue #332
Comments
we switched out the place where totalServerItems is set because people On Fri, Apr 12, 2013 at 6:44 AM, richtmat notifications@github.com wrote:
-Tim Sweet |
OK now I set $scope.gridOptions.totalServerItems statically and if totalServerItems > pageSize I can see that value. But if I use a $http call to get the items from the server totalServerItems is not set (maybe because of async?). Also the maxRows() function from ngFooter Controller is called only once. How do I trigger another call? |
are you using the $http or $timeout services? because it should just be a On Mon, Apr 15, 2013 at 3:05 AM, richtmat notifications@github.com wrote:
-Tim Sweet |
yes, I am using $http, encapsulated in a angular service at the first line of my controller. |
once the promise resolves a $digest shold be triggered. can you repro in a plunker? |
here we go: http://plnkr.co/edit/tuCxztnymOF55SlGLeuj?p=preview I have two ng-grid versions here to test. Using the old one leads to output of null, using 2.0.4 shows my initial value. Outside of the table the correct value is shown. |
hi @timothyswt , I'm still stuck on that issue. I dug into the sources and believe that the current implementation does not allow for a change of a once set totalServerItems value. I think it is necessary because of async retrieving that value from the server and because of regular changes in datasets which would not be updated. |
Thanks to @keithharvery for the PR. The `totalServerItems` grid option can once again be set to a string, which will be watched by the grid and reflected in the footer if updated. Also added tests to directivesSpec.js for using a normal number and using a string.
Thanks to @keithharvery for the PR. The `totalServerItems` grid option can once again be set to a string, which will be watched by the grid and reflected in the footer if updated. Also added tests to directivesSpec.js for using a normal number and using a string.
Example http://plnkr.co/edit/4LyAek?p=preview from http://angular-ui.github.io/ng-grid/ have this bug too. |
This is exactly what I was looking for. Now I know why they were split. "we switched out the place where totalServerItems is set because people |
There's another issue, when I page the itens, and change page selected itens becomes null. |
I got this issue fixed by updating totalServerItems on every paging action $scope.setPagingData(data,page,pageSize); on success $scope.setPagingData = function(data, page, pageSize){ |
I used $scope.gridApi.grid.option.totaltems and it is started working |
I agree with @nkantkumar: $scope.gridApi.grid.option.totalItems properly sets the footer's totalItem count. |
Total Items in the footer does not show the $scope.pagingOptions.totalServerItems I configured.
Instead, it reads from grid.config.totalServerItems.
The text was updated successfully, but these errors were encountered: