DS Server

EditableRegion Object

Object|Introduced in 28.0

Description

An EditableRegion object represents an editable region in a document.

Syntax

EditableRegion

Examples

The following example demonstrates EditableRegion in a practical document-editing workflow. An EditableRegion object represents an editable region in a document.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectEditableRegion(editableRegion) {
    editableRegion.getID(
        function(result) {
            console.log("get id result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getHighlightColorGets the highlight color for the editable region.
getHighlightModeGets a value indicating whether the editable region is highlighted.
getIDGets an identifier for a editable region.
getLengthGets the number of characters which belong to the editable region.
getStartGets the index (one-based) of the first character which belongs to the editable region.
getTextGets the editable region's text.
getUserNameGets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.
saveSaves this editable region in a certain format and sends the result back asynchronously by calling a given callback function.
scrollToSets the current input position to the beginning of an editable region and scrolls it into the visible part of the document.
setHighlightColorSets the highlight color for the editable region.
setHighlightModeSets a value indicating whether the editable region is highlighted.
setIDSets an identifier for the editable region.
setUserNameSets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.