Event Author API

save:activity

Fires before an Activity is to be saved.

You would want to be notified about this event firing, because you might want to display your own custom save dialog or you might want to run additional validation on the current Activity before saving, for example.

When the event has fired, you can use event.preventDefault() to prevent the Activity from being saved.

Examples

authorApp.on('save:activity', function () {
    console.log('This code executes before an Activity is to be saved.');
});

Callback arguments

The event callback function will be called with an AuthorEvent instance as an argument (unless indicated otherwise). The AuthorEvent object provides further information for the event that has been fired. Additional data attributes listed below can be accessed from the event.data object. The AuthorEvent object will look like the example below:

authorApp.on('[name of the fired event]', function (event) {
    console.log(event);
    /*
        {
            "name": "[name of the fired event]",
            "data": {
                // additional data attributes
            }
        }
    */
});
  • activityJson object
    JSON of the Activity to be saved.

Related articles

Was this article helpful?