I'm trying to trigger some client code after a record has been saved. To do this I have tried to listen for the 'after:save' event like this:
'after:render' triggers by 'after:save' does not. I'd rather add a listener than override and existing action.
What am I doing wrong?
Code:
define('studibase:after-save-handler', [], function() { var Handler = function(view) { this.view = view; }; _.extend(Handler.prototype, { process: function() { this.listenTo(this.view, 'after:render', function() { alert('render!'); this.listenTo(this.view, 'after:save', function() { alert('save!'); }, this); }, this); }, }); _.extend(Handler.prototype, Backbone.Events); return Handler; });
What am I doing wrong?