Items: Array;
The Items property determines array of menu items.
Use JSON or the setItems method to set the property value and the getItems method to get the property value.
To execute the example, the <head> tag of HTML page must include links to the PP.js script file and the PP.css styles file and the example itself must be placed within the <script> tag. Add the <div> element with the "Panel" class to the <body> tag. Create an element for editing signature mask:
// Create panel container var container = new PP.Ui.GridPanel({ ParentNode: document.getElementById("Panel") } ); // Create element of editing lanel mask and add it to container SignEditor = new PP.Ui.SignaturesEditor ({ Currencies: [{ Name: PP.resourceManager.getString('Content', 'visMasterTooltipsCurrencyR'), Postfix: ' p.' },{ Name: PP.resourceManager.getString('Content', 'visMasterTooltipsCurrencyE'), Prefix: '€' },{ Name: PP.resourceManager.getString('Content', 'visMasterTooltipsCurrencyD'), Prefix: '$' }], FormatDelimeter: "=", DefaultFormatType: PP.Ui.SignEditorFormatType.Number, DefaultDecimalPlaces: 0, DefaultCurrency: 0, DefaultDelimeter: PP.Ui.SignEditorThousandsDelimeterType.Both, Formats: [PP.Ui.SignEditorFormatType.Number, PP.Ui.SignEditorFormatType.Percentage], VariablePostfix: "}", VariablePrefix: "{%" }); container.add(SignEditor); // Create array of substitutions var templates = [{ Type: PP.Ui.SignEditorItemType.Caption, Name: PP.resourceManager.getString('Content', 'visMasterTooltipsTemplates') },{ Type: PP.Ui.SignEditorItemType.Variable, Name: PP.resourceManager.getString('Content', 'visMasterTooltipsColorName'), Value: 'ColorTitle' }, { Type: PP.Ui.SignEditorItemType.NumberVariable, Name: PP.resourceManager.getString('Content', 'visMasterTooltipsColorValue'), Value: 'ColorValue' },{ Type: PP.Ui.SignEditorItemType.Variable, Name: PP.resourceManager.getString('Content', 'visMasterTooltipsItemName'), Value: 'Name' }] // Determine additional settings SignEditor.setDecimalPlaces(3); SignEditor.setDelimeter(PP.Ui.SignEditorThousandsDelimeterType.With); // Add substitutions SignEditor.setItems(templates); // Set current value of edit field SignEditor.setFormula("Color metric: {%ColorTitle} - {%ColorValue}") // Add events SignEditor.TextChanged.add(function(sender, args){ console.log("TextChanged event"); console.log(args); }); SignEditor.AfterTimeout.add(function(sender, args){ console.log("AfterTimeout event"); }); // Get panel elements console.log(SignEditor.getMenuButton()); console.log(SignEditor.getTextArea()); console.log(SignEditor.getMenu());
As a result, a panel for editing signature mask is added to the page.
See also: