[SAMPLE] simulate pagination bug when adding new row #511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pagination extension is not being notified about adding new item into observable store in the case when item should be inserted into the next page.
The root of this problem seems to be inside dojo/store/Observable
https://github.com/dojo/dojo/blob/master/store/Observable.js#L103
Variable insertedInto equals -1 which prevents notifying listeners (in this case pagination extension) about changes and therefore grid will not update total count of items neither page links. User can not see new rows, because these rows are on the other page, however link to the other page was not created... User will see new rows only in the case, when other notification was fired (sort, delete, etc).
We have added simple testcase where you can try it. Just create more than three rows.
When you comment out line 103 in Observable store, it seems to be working correctly.