Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4837

Remove multiple records at once

$
0
0

@marxsk wrote:

I have backend that allows me to remove multiple records at once. When I need to delete only one record:

  • record.deleteRecord()
  • record.save()
  • user interface is updated so user see that this we are in process of deleting record (as it can take several seconds)
  • response from backend -> record is deleted from the local store
  • record is removed from UI

Doing it for multiple records:

  • this.get(‘store’).deleteMultipleRecords(array-of-records) – returns promise as .save();
  • manually mark all records with record.deleteRecord() -> so user interface is updated as before
  • response from backend -> for every record do record.unloadRecord()
  • records are removed from UI

what is the best-practise?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4837

Trending Articles