Report an issue
Class

CKEDITOR.plugins.autocomplete.view

classsince 4.10.0private

Class representing the autocomplete view.

In order to use a different view, implement a new view class and override the CKEDITOR.plugins.autocomplete.getView method.

myAutocomplete.prototype.getView = function() {
    return new myView( this.editor );
};

You can also modify this autocomplete instance on the fly.

myAutocomplete.prototype.getView = function() {
    // Call the original getView method.
    var view = CKEDITOR.plugins.autocomplete.prototype.getView.call( this );

    // Override one property.
    view.itemTemplate = new CKEDITOR.template( '<li data-id={id}><img src="{iconSrc}" alt="..."> {name}</li>' );

    return view;
};

Note: This class is marked as private, which means that its API might be subject to change in order to provide further enhancements.

Filtering

Properties

  • readonly

    document : document

    The document to which the view is attached. It is set by the append method.

  • readonly

    editor : editor

    The editor instance.

  • readonly

    element : element

    The view's main element. It is set by the append method.

  • readonly

    itemTemplate : template

    The panel's item template used to render matches in the dropdown.

    You can use data item properties to customize the template.

    A minimal template must be wrapped with a HTML li element containing the data-id="{id}" attribute.

    var itemTemplate = '<li data-id="{id}"><img src="{iconSrc}" alt="{name}">{name}</li>';
    
  • readonly

    selectedItemId : Number | String

    The ID of the selected item.

Static properties

Methods