kendo ui context menu is not working when Kendo ui editor id target

1k Views Asked by At

Kendo UI Context Menu is not working when its target is the Kendo UI Editor's id:

<textarea id="keditor" kendo-editor kendo-toolbar style="width: 100%; overflow: scroll">
</textarea>

script:

$("#client-context-menu").kendoContextMenu({
    target: "#keditor",
    dataSource: response.Item.AgreementParameters
});
1

There are 1 best solutions below

0
On

This is not very visibly documented, but Kendo's editor has two very different work modes: classic and inline.

If you use the default textarea element for initializing the Editor, the Editor assumes its classic mode. The textarea is not visible and is used to hold the value of the widget. You can type in the contenteditable iframe that is created.

If you initialize the Editor from a div element, the widget assumes its inline mode. The element is content-editable and is used by the widget to return its value.

In your case, the element is a textarea, so the editor's content is in an iframe, so the right-click is in another context and doesn't trigger the context menu.

If you bind the editor to a div, it works, see sample: https://dojo.telerik.com/@GaloisGirl/iTowIkEW