addButton (value: JSON | PP.Ui.Button | PP.Ui.TabControl, position: PP.LTRB, _isItem: Boolean, fireEvent: Boolean);
value. Item to be added.
position. Panel position where the item will be added.
_isItem. Determines if the item must be added as a tab or a button. By default it is set to False: that is, item is added as a button. If the value is True, the element is added as a tab.
fireEvent. Determines whether the TabControl.AddButton event is fired on method execution. By default the parameter is set to True and the event is fired.
The addButton method adds a button to the TabControl component.
To execute the example, the page must contain the TabControl component named tabcontrol (see Example of Creating the TabControl Component). Add a button to the TabControl component:
tabcontrol1.AddButton.add(function (sender, args) { console.log("Addition of the button named " + args.Button.getContent()); }); tabcontrol1.addButton({Content: "Button"}, "Top", false, true);
After executing the example a button is added to the TabControl component, and the following message is displayed: Addition of the button named Button:
See also: