TextPartCollection Object
Description
Contains all text parts in a TX Text Control document.
Syntax
TextPartCollectionExamples
The following example demonstrates TextPartCollection in a practical document-editing workflow. It contains all text parts in a TX Text Control document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getItem(
function(subTextPart) {
if (!subTextPart) {
console.warn("No sub text part was returned.");
return;
}
console.log("get item result:", subTextPart);
},
onTxError
);Members
Methods
| Method | Description |
|---|---|
| activate | Sets the input focus to the specified text part. If the activated text part is not in the visible part of the document, the document is scrolled. |
| 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.) |
| getItem | Gets the text part with the input focus. |
| getMainText | Gets the main text part of the document. |