Collection Object
Description
Provides methods for accessing collections.
Syntax
CollectionExamples
The following example shows how to retrieve all application fields from the document's main text and do something with them afterwards:
let fields = [];
TXTextControl.applicationFields.forEach((field, i, n) => {
fields.push(field);
if (i == (n - 1)) {
console.log(`${fields.length} application fields retrieved!`);
// Do something meaningful with the retrieved fields here...
}
});
Possible console output after calling this code:
> 17 application fields retrieved!The following example demonstrates Collection in a practical document-editing workflow. It provides methods for accessing collections.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectCollection(s) {
s.getCount(
function(result) {
console.log("get count result:", result);
},
onTxError
);
}