configuring CKEditor.

edited July 2014 in Technical questions

Hi Maksim, wondering if you have an example of how to customize CKEditor, ie: chose toolbar items, make it editable/non-editable.

Thanks

Comments

  • edited July 2014

    Figured out the answer by looking at the ckeditor.js file in the master components directory.

    It looks like webix sets 'toolbar' and 'borderless' as webix custom component defaults.
    Therefore to change these, you do so directly on the object literal defining the editor view.

    ie: to have no toolbar:

    {
        view    : "ckeditor",
        height  : 500,
        width   : 700,
        toolbar : []
    }
    

    It seems that webix names the first ckeditor: "cke_1"

    So, for other properties:

    var instances = window['CKEDITOR'].instances
    for (var k in instances) {
      var v = instances[k]
      if (v.id == 'cke_1') {
         // v is the editor with id: cke_1
         v.readOnly = true
       }
    }

    Once you have the editor instance, you set the properties directly,
    e.g: to make the editor read only, you'd get the editor, as above, then:
        editor.readOnly = true
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion