addACTerms(data: PP.Ufe.Ui.Term || Array);
data. Term or array of terms described as an object, string or object of the PP.Ufe.Ui.Term class.
The addACTerms method adds a hint term to term editor.
To execute the example, the page must contain the TermEdit component named termEdit (see Example of Creating the TermEdit Component). Add a tooltip term with the Term contents and set a new style for it, also add the ignored term with the _ contents:
// Add a tooltip term acTerm = new PP.Ufe.Ui.Term({ Content: "Term", }); acTerm.setDomNode(PP.htmlToDOM("<div class='MyTermClass'>Term</div>")); termEdit.addACTerms(acTerm); // Add a new ignored term termEdit.getIgnoreTerms().push("-"); // Create a new style var style = new PP.Style({ // Set background color of tooltip window Background: new PP.SolidColorBrush({ Color: PP.Color.Colors.lightgreen }) }); // Set tooltip style termEdit.setACStyle(style);
Enter the T character to the term editor window. As a result a tooltip for term autofit is displayed:
Add the following expression to the editor: 100-10:
Get total expression length and output formula:
//Get expression length console.log("Total expression length: " + termEdit.getLength()); // Get output formula console.log("Formula: " + termEdit.getFormula());
As a result the console displays expression length and output formula:
Total expression length: 6
Formula: 10010
The output formula will not contain the - character because it was added to ignored terms.
See also: