ReadonlychildrenA collection of child views in the form.
ReadonlykeystrokesThe label of the header.
Focuses the remove button instead.
Recursively renders the view.
Once the view is rendered:
true.Note: The children of the view:
In general, render() method is the right place to keep the code which refers to the
#element and should be executed at the very beginning of the view's life cycle.
It is possible to module:ui/template~Template.extend the #template before
the view is rendered. To allow an early customization of the view (e.g. by its parent),
such references should be done in render().
class SampleView extends View {
constructor() {
this.setTemplate( {
// ...
} );
},
render() {
// View#element becomes available.
super.render();
// The "scroll" listener depends on #element.
this.listenTo( window, 'scroll', () => {
// A reference to #element would render the #template and make it non-extendable.
if ( window.scrollY > 0 ) {
this.element.scrollLeft = 100;
} else {
this.element.scrollLeft = 0;
}
} );
}
}
const view = new SampleView();
// Let's customize the view before it gets rendered.
view.extendTemplate( {
attributes: {
class: [
'additional-class'
]
}
} );
// Late rendering allows customization of the view.
view.render();
The blocked word view. This view consists of a label and a button. It shows a single word, that is part of the block list, based on the current selection inside the editor. The word can be removed from the list via the button.