TX Text Control .NET Server

Javascript: TextFrameCollection.remove Method

Method|Introduced in 28.0

Description

Removes a text frame from a Text Control document.

Syntax

<void> TextFrameCollection.remove(<TextFrame> text, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
text

frame - Specifies the text frame to remove.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TextFrameCollection.remove in a practical document-editing workflow. It removes a text frame from a Text Control document.

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

function remove(text) {
    TXTextControl.textFrames.remove(
        text,
        function() {
            console.log("remove completed.");
        },
        onTxError
    );
}