StackPanel (settings)
settings. JSON object that contains values of component properties.
The StackPanel constructor creates an instance of the StackPanel component.
To execute the example, add links to the files PP.js and PP.css. In the BODY tag add DIV items with the stPan1 and but1 identifiers. Create a StackPanel component, panels of which are added on clicking the Add button:
var stackPanel = new PP.Ui.StackPanel( { ParentNode: document.getElementById("stPan1"), Width: 500, Height: 200, MinControlSize: 50 }); var stacks = []; var but1 = new PP.Ui.Button( { Content: "Add", ParentNode: document.getElementById("but1"), Click: add }) function add() { var newItem = new PP.Ui.Button( { Content: "Panel: ", ResourceKey: "StackPanel" }) newItem.setContent(newItem.getContent() + stacks.length); stackPanel.add(newItem); stacks.push(newItem); }
After executing the example the Add button is placed in the page. Clicking the button adds items to the StackPanel component:
See also: