TextEditor.TextChanged

Syntax

TextChanged: function(sender, args, timeout);

Parameters

sender. Event source.

args. Event information.

timeout. Time delay (milliseconds) after which the event is fired.

Description

The TextChanged event is fired on changing text in editor's text area.

Example

To execute the example, the page must contain TextEditor component named textEditor (see description of TextEditor constructor). Handle the following events: TextChanged, SelectionChanged, Blur:

// Declare event flags
var isTextChanged = false;
var isTextSelected = false;
var isBlured = false;
// Handle text change event
textEditor.TextChanged.add(function (sender, args, timeout) {
    if (!isTextChanged) {
        console.log("The TextChanged event initialized");
        isTextChanged = true;
    }
});
// Handle text selection change event
textEditor.SelectionChanged.add(function (sender, args) {
    if (!isTextSelected) {
        console.log("The SelectionChanged event initialized");
        isTextSelected = true;
    }
});
// Handle focus loss event
textEditor.Blur.add(function (sender, args) {
    if (!isBlured) {
        console.log("The Blur event initialized");
        isBlured = true;
    }
});

Select any word in the editor by double-click on it, and then change it. After that select all text and change its horizontal alignment using the button in the text editor settings panel. The action moves the focus from the text area to settings area. As a result, the browser console shows messages on firing the previously handled events:

The SelectionChanged event is initialized

The TextChanged event is initialized

The Blur event is initialized

See also:

TextEditor