Grid paging counts do not properly update when dynamically adding/removing rows
There are tutorials on how to dynamically add and remove rows from a grid, each revolving around updating the 'data' array in grid options. This works beautifully for including new rows of data, or removing rows, without having to make additional requests of the server to 'reload' the grid. The only issue is that pagination counts are not updated when changes are made.
For instance, if I have a grid with a total count of 55 records, and I'm displaying items 1 to 25, and I remove a row, then I would expect the total count to be decremented by 1, and the display to now say I'm viewing items 1 to 24. Now, in my method where I remove the array element from data I can also update my options.totalItems easily (manually), but that still doesn't update the '1 or 25' count. Currently that count uses $scope.showingHigh, which is based on a calculation. I can't provide a new value for this without hacking the component, or by changing the paginationPageSize (which would then trigger a reload of the grid). Perhaps the calculation could be changed to use the array length, rather than the paginationPageSize? I know that would be problematic when also doing client side filtering, so I'm not entirely sure of the logic needed...
I am facing the exact same issue. @cutterbl Let me know if you found a workaround for it.
did u get any workaround for this?
same issue here!
I haven't implemented this yet, but this article is kind of talking about the issue and possible solutions https://coderwall.com/p/lkcaag/pagination-you-re-probably-doing-it-wrong