Question Editor API Events
input:removed
Fires when the Widget (Question or Feature) view has an input field removed.
You would want to be notified about this event firing because you might want to run some custom logic to the HTML when an input field is removed.
This event is fired when an author removes an input field, for example, a multiple choice option.
The on()
or once()
methods can be used to listen to this event.
Note This is fired for each attribute path removed - so removing a single multiple choice option, for example, may result in this firing several times, once for each path.
Examples
// Run each time the event is fired
authorApp.on('widgetedit:input:removed', function (event) {
console.log('This code executes when an input is removed (for each attribute path). It contains the attribute path of the input element at event.attributePath.');
});
Callback arguments
-
event object
Additional information about the removed input field.
-
attribute_path string
See Internationalization which contains information about attribute paths.
-
el object
The HTMLDomElement.
-