New to Kendo UI for jQueryStart a free 30-day trial

Handle Blur and Focus Events in the Editor

Environment

ProductProgress® Kendo UI® Editor for jQuery
Operating SystemWindows 10 64bit
Visual Studio VersionVisual Studio 2017
Preferred LanguageJavaScript

Description

How can I handle focus and blur events in the Kendo UI for jQuery Editor?

Solution

The Editor does not expose focus and blur events as built-in functionalities.

However, regardless of the initialization mode you apply to the widget, you can handle them by using JavaScript.

The following example demonstrates how to handle the blur and the focus events of the Editor.

    <style>
      #editor{
        position: absolute;
        width: 90%;
        top: 60px;
      }
    </style>
    <body>
      <textarea id="editor"></textarea>
      <script>
        var editor = $('#editor').kendoEditor().data('kendoEditor');
        $(editor.body).focus(function(){
          console.log('Focus');
        }).blur(function(){
          console.log('Blur')
        });
      </script>

See Also