0

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
});
Shai
  • 3,659
  • 2
  • 13
  • 26
  • When you say that it's not working, what exactly do you mean? Is nothing happening? Are you getting an exception or an error message? – Shai Jan 22 '20 at 12:10

1 Answers1

2

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

GaloisGirl
  • 1,476
  • 1
  • 8
  • 14