EditableRegionCollection Object
Description
Contains all editable regions in the main text or another part of a document. When the EditMode has been set to ReadAndSelect, editable regions can still be edited, by a certain user.
Syntax
EditableRegionCollectionExamples
The following example demonstrates EditableRegionCollection in a practical document-editing workflow. It contains all editable regions in the main text or another part of a document. When the EditMode has been set to ReadAndSelect, editable regions can still be edited, by a certain user.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const editableRegions = mainText.editableRegions;
editableRegions.getItems(
function(result) {
if (!result) {
console.warn("No editable region was returned.");
return;
}
console.log("get items result:", result);
},
onTxError
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Adds a new editable region to the document. Its position is defined through the start and length parameters. If the editable region's length is zero, the current text selection is used to define the position. |
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItems | Gets all editable regions at the current text input position. The callback returns null, if there is no region at the current input position. |
| remove | Removes an editable region from the collection. The region's text is not removed. |