In the depicted scenario, there are no changes and the _pristineData holds the items sorted with the newest item at the end of the data source data array. When a subsequent read is requested, the server responds with the dataItems ordered by their creation in descending order.
There are several options to prevent this and in your scenario, the easiest one is to check for changes. If there are no changes, do not call the cancelChanges() method:
This is a wrong behavior since you are providing an option for the new row to be on top or at the bottom. So, the _pristineData should set the priority of the new based on the position of the new row
answered on 12 Dec 2016, 04:17 PM
You seem to have a valid point regarding the expected behaviour when cancelling changes. However, please note that to ensure that the data is sorted, you should add a sort configuration or implement your own method of comparison: