Closed julie4754 closed 2 years ago
This may be related to #6897. Although the scenario I have given is not client side filtering, the scenario is similar in that the pager is showing incorrect row numbers and totals when the data on display has been updated/refreshed.
Close the issue as I created a plunkr and found that it was working in the plunkr which gave an indication that this should work.
We have created a web page which uses external server side pagination so that the client side only loads the current page of data.
While a user is viewing a page, they can click on a custom refresh icon to fetch refreshed data from the server. This refresh may add and/or take away rows from the total and the total may change.
We have set the following key grid options:
We have registered the api to call custom code to fetch the data:
And the refresh icon calls does similar as:
where refreshListComponent is:
As the code was setting the total number of items, we expected the default pager template to contain an updated '1 - 10 of 1886 items' with the updated total and if the user is on the last page and there is a new row, this section to change from '1881 - 1886 of 1886 items' to '1881 - 1887 of 1887 items' when the fetch of updated data included a now row. The grid data does show the correct rows, but the pager is out of date even though the totalItems was updated. A trace of this scenario shows that although the grid pager shows '1881 - 1886 of 1886 items', the value of totalItems is in fact 1887.
Similarly, if the user is on the second to last page and then clicks on the next page icon, the total number of items is not updated even though debugging shows that the totalItems variable was updated.
Is there a defect here that updating the totalItems is not updating the pager? We have looked at the tutorials and API, but cannot find anything to address this issue.