Event Author API

render:widgets

Fires when widgets are visually refreshed (re-rendered) when navigating from edit to preview mode in the Item editor.

You would want to be notified about this event firing, because you might want to take some action when the Questions and Features have been reloaded and rendered, for example.

Note This event is not fired if the whole Item is rendered, for example, when navigating from the Item settings page back to Item edit. In that case, the render:item event is fired.

Examples

authorApp.on('render:widgets', function (widgetReferenceList) {
    console.log("This code executes when an Item's Questions and Features have been re-rendered.");
    console.log(widgetReferenceList);
});

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
            }
        }
    */
});
  • widgetReferenceList array

    Array of widget references which were re-rendered.

    The widget references refer to the rendered DOM elements and can be selected using:

    document.querySelector('[data-authorapi-widget-reference="the-returned-widget-reference"]');
Was this article helpful?