I try to create ‘loadMore’ feature.
My code for action ‘loadMore’:
this.store.findQuery('user', {
skip: _this.get('skipped'),
limit: _this.get('limit'),
sort: _this.get('sort')
}).then(function(newData) {
_this.get('model').pushObjects(newData.get('content'));
_this.set('model.meta.total', newData.get('meta.total'));
_this.set('skipped', _this.get('skipped') + _this.get('limit'));
});
My action for removing
remove: function(item) {
item.destroyRecord();
},
My template
{{#each model as |row|}}
<tr>
<a {{action 'remove' row}}>remove</a>
</tr>
{{/each}}
<a {{action 'loadMore'}}>loadMore</a>
When I remove a row which initially loaded via route’s model, my template is updated. But when I click on ‘loadMore’ and try to delete new records, they are deleted from server (ajax works), but my model contains these items with property isDeleted == true, and template is not updated.
Why?
I use Ember 1.12.0