I have action to rollback changes in controller:
edit: ->
@set 'isEditing', true
doneEditing: ->
@set 'isEditing', false
@get('positions').save()
@get('participants').save()
destroyParticipant: (participant) ->
participant.deleteRecord(participant)
newParticipant: (participant) ->
@get('participants').createRecord(participant)
cancelEditing: ->
@set 'isEditing', false
@get('model.positions').forEach (record) ->
record.rollback()
@get('model.participants').forEach (record) ->
record.rollback()
The problem is, I want to delete the record and after "Cancel editing" to show again this deleted record (because it's still in db).
Aucun commentaire:
Enregistrer un commentaire