Created
November 28, 2011 10:05
-
-
Save ralfschimmel/1399845 to your computer and use it in GitHub Desktop.
saving newly created nested records to a relation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addActor: function() { | |
........ | |
var actor = this.actorNestedStore.createRecord(Bw.AssignmentActor, {}); | |
this.newActors.pushObject(actor); | |
............ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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