ExtJS 4.1 : How to combine local data with ajax loaded data in a single store?

寵の児 提交于 2019-12-05 21:21:14

You can use .load({addRecords: true} to add loaded records to existing records.

Of course if you load again with the addRecords: true option enabled it will add the records to the existing records again resulting in:

[{ id: 1, name: 'John' },{ id: 2, name: 'Jack' },{ id: 2, name: 'Jack' }]

You could implement a before load handler to reset the store to the original data and load again if you want only [{ id: 1, name: 'John' },{ id: 2, name: 'Jack' }] every time you load again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!