Skip to content

Instantly share code, notes, and snippets.

@ralfschimmel
Created November 28, 2011 10:05
Show Gist options
  • Save ralfschimmel/1399845 to your computer and use it in GitHub Desktop.
Save ralfschimmel/1399845 to your computer and use it in GitHub Desktop.
saving newly created nested records to a relation
addActor: function() {
........
var actor = this.actorNestedStore.createRecord(Bw.AssignmentActor, {});
this.newActors.pushObject(actor);
............
}
saveAssignment: function() {
this.nestedStore.commitChanges();
//newActors bevat de objecten die in de nested store zijn aangemaakt
this.newActors.forEach(function (actor) {
Bw.editAssignmentController.get('actors').pushObject(Bw.store.find(actor));
});
Bw.store.commitRecords();
this.closeAssignment();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment