kendo-uikendo-editor

Kendo ui editor body background picker


Is there a way to create a custom color picker to change the editor's body background color? I looked at the documentation and it seems that the palette is just available for font color and text background color, not body background color.


Solution

  • You can change the background color of the editor using:

    $("#editor").data("kendoEditor").body.style.backgroundColor = 'red'

    All you need is to hook the select option on the color picker to set the editor's background color with the selected value.

    $("#picker").kendoColorPicker({
        value: "#ffffff",
        buttons: false,
        select: function(e) {
            $("#editor").data("kendoEditor").body.style.backgroundColor = e.value;
        }
    });
    

    See here for a sample: http://dojo.telerik.com/EYusEQ/2