Events
The Author API exposes number of public events so you can trigger custom functionality.
Supported events list
The callback will be called with a PublicEvent instance as an argument (unless indicated otherwise), which provides access to event data. The Event Data column gives information of what can be found in theevent.data
object.
Event name | Description | Event data |
---|---|---|
activityduplicate:error
|
Fires after an Activity has failed to duplicate. If this is a shallow copy, this fires after the Version added: v2020.3.LTS |
|
activityduplicate:success
|
Fires after an Activity has successfully duplicated. If this is a shallow copy, this fires after the Version added: v2020.3.LTS |
|
activityedit:item:create
|
Triggered when the “Create Item” button is clicked in the Activity Editor.
|
|
activityedit:item:edit
|
Triggered when an Item reference or title is clicked in the Item list of the Activity Editor.
|
|
activityedit:items:added
|
Triggered when the “Add Items” button is clicked in the Item picker of the Activity Editor.
|
|
activityedit:saveable:changed
|
Triggered when the Activity becomes either saveable or not saveable. It is also triggered when the Activity edit view is rendered. This event is controlled by the same conditions that control whether the Author API's save button is clickable. Since these conditions could change, this event may behave differently in different versions of Author API. Therefore, this event is useful if you are creating your own save button and you want it to behave similiar to the Author API save button. Version added: v2020.2.LTS |
|
add:widget
|
Triggered after an author clicks on the add widget button. Use Version added: |
|
itemduplicate:confirm
|
Triggered after an author confirms duplication of an Item. This is only fired if the Item contains a shared passage.
|
|
itemedit:changed
|
Triggered after an author changes the Item layout, dynamic data or Item tags.
|
|
navigate
|
Triggered when the app location changes, e.g. when visiting an Item from the Item list; when doing a search; when going back from an Item to the Item list; etc. Can use Version added: |
|
open:activity
|
Triggered when an Activity in the Activity list is clicked. Can use Version added: |
|
open:item
|
Triggered when an Item in the Item list is clicked. Can use
Version added: |
|
render:activity
|
Triggered after an Activity has finished rendering.
|
|
render:activitylist
|
Triggered after the Activity list has finished rendering. The event is triggered after the first load of the Activity list, every search, sorting, and when loading additional pages.
|
|
render:item
|
Triggered after an Item (including any questions or features it contains) has finished rendering.
|
|
render:widgets
|
Triggered after only widgets (Questions and Features) are re-rendered in an Item (e.g. when navigating from edit to preview mode). This event is not triggered if the whole Item is rendered (e.g. when navigating from Item settings back to Item edit).
|
|
render:itemlist
|
Triggered after the Item list has finished rendering. The event is triggered after the first load of the Item list, every search, sorting, and when loading additional pages.
|
|
save
|
Triggered before an Item is to be saved. Can use If the Version added: |
|
save:activity
|
Triggered before an Activity is to be saved. Can use Version added: |
|
save:activity:error
|
Triggered after an Activity has failed to save.
|
|
save:activity:success
|
Triggered after an Activity has successfully saved.
|
|
save:error
|
Triggered after an Item has failed to save.
|
|
save:success
|
Triggered after an Item has successfully saved.
|
|
widgetedit:editor:ready
|
Only supported when using Question Editor v3.
Triggered when the Question Editor has finished loading all of the Global Layout components (e.g. tile view/editor view). For example, it is triggered after init() or reset() methods have successfully completed.
|
|
widgetedit:preview:changed
|
Only supported when using Question Editor v3.
Triggered when the author modifies any widget attributes and the question preview updates. |
|
widgetedit:widget:changed
|
Only supported when using Question Editor v3.
Triggered when the editor changes states, e.g. when an author chooses a widget from the tile view or the setWidget() method is called.Note that it is not triggered when an attribute within the widget changes, use widgetedit:preview:changed for that.
|
|
widgetedit:widget:ready
|
Only supported when using Question Editor v3.
Triggered when the editor panel has finished rendering and can be interacted with. Can occur after setWidget() is called or the author chooses a widget from the tile view.
|
|
itemlist:selection:changed
|
Only supported in
item_list mode and when
item selection is enabled.Triggered whenever the author selects/unselects an Item, and also when the clearSelectedItems() public method is called.Note: If the author selects a few Items then opens an Item (clicks an Item reference/title), the previously made selection will be lost and the itemlist:selection:changed public event will not be fired.
|
|
Event name | Description | Event data |
---|---|---|
widgetedit:editor:ready
|
Only supported when using Question Editor v3.
Triggered when the Question Editor has finished loading all of the Global Layout components (e.g. tile view/editor view). For example, it is triggered after init() or reset() methods have successfully completed.
|
|
widgetedit:preview:changed
|
Only supported when using Question Editor v3.
Triggered when the author modifies any widget attributes and the question preview updates. |
|
widgetedit:widget:changed
|
Only supported when using Question Editor v3.
Triggered when the editor changes states, e.g. when an author chooses a widget from the tile view or the setWidget() method is called.Note that it is not triggered when an attribute within the widget changes, use widgetedit:preview:changed for that.
|
|
widgetedit:widget:ready
|
Only supported when using Question Editor v3.
Triggered when the editor panel has finished rendering and can be interacted with. Can occur after setWidget() is called or the author chooses a widget from the tile view.
|
|
Event name | Description | Event data |
---|---|---|
All Events
|
All of the events which can be bound via the
On public method can be unbound using the Off method. |