CoreMedia CKEditor 5 Plugins
    Preparing search index...

    A view, displaying an input field and a save button next to it. This view is used to provide an input for words that should be saved as "blocked words".

    This view is controlled via the blocklistCommand and addToBlocklistCommand.

    Hierarchy

    • View
      • BlocklistInputView
    Index

    Constructors

    Properties

    children: ViewCollection

    A collection of child views in the form.

    keystrokes: KeystrokeHandler = ...

    An instance of the KeystrokeHandler.

    saveButtonView: ButtonView

    The Save button view.

    wordToBlockInputView: LabeledFieldView<InputTextView>

    The URL input view.

    Methods

    • Recursively renders the view.

      Once the view is rendered:

      • the #element becomes an HTML element out of #template,
      • the #isRendered flag is set true.

      Note: The children of the view:

      • defined directly in the #template
      • residing in collections created by the #createCollection method,
      • and added by #registerChild are also rendered in the process.

      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();

      Returns void