2

I'm developing a push application and need to remove items from a DS.Store without invoking any actions. I'm able to insert objects using load(), but need to be able to "unload" an object after it has been deleted on another client.

Thanks

4

2 に答える 2

14
record.unloadRecord();

This clears belongsTo and hasMany relationships on the record and then transitions the record to the deleted.saved state, all without sending anything to the server.

于 2013-05-12T01:36:58.123 に答える
2

ストアからレコードを削除するのではなく、レコードの状態を変更するだけです。

record.get('stateManager').goToState('deleted.saved');

ember-data V〜1.0の場合、以下を使用します。

record.transitionTo('deleted.saved');
于 2012-06-14T06:30:51.230 に答える