kendoEditor.element.focus();
kendoEditor.element.select('body').focus();
No luck so far. Any suggestions?
4 Answers, 1 is accepted
The focus() method of the Editor is of the widget object:
$("#EditorID").data("kendoEditor").focus();
If kendoEditor in your case is the textarea jQuery object, then try
kendoEditor.data("kendoEditor").focus();
Dimo
the Telerik team
Help me please!
I can't set focus into editor. You can see a text below.
<div id="example">
<div class="demo-section k-content">
<div>
<h4>Enter some content</h4>
<textarea data-role="editor"
data-tools="['bold',
'italic',
'underline',
'strikethrough',
'justifyLeft',
'justifyCenter',
'justifyRight',
'justifyFull']"
data-bind="visible: isVisible,
value: html,
events: { change: onChange }"
style="height: 200px;"></textarea>
</div>
<div style="padding-top: 1em;">
<h4>Console</h4>
<div class="console"></div>
</div>
</div>
<script>
var viewModel = kendo.observable({
html: null,
isVisible: true,
onChange: function() {
kendoConsole.log("event :: change (" + kendo.htmlEncode(this.get("html")) + ")");
}
});
kendo.bind($("#example"), viewModel);
</script>
</div>
I finded a solution:
...
kendo.bind($("#example"), viewModel);
$('[data-role="editor"]').data('kendoEditor').focus();