CoreMedia CKEditor 5 Plugins
    Preparing search index...

    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.

    Hierarchy

    • View
      • BlockedWordView
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    children: ViewCollection

    A collection of child views in the form.

    keystrokes: KeystrokeHandler = ...
    label: string

    The label of the header.

    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