TabControl.AfterAddItem

Syntax

AfterAddItem: function (sender, args: PP.TabControlArgs);

Parameters

sender. Event source.

args. Event information.

Description

The AfterAddItem event occurs after a new tab is added to the component.

Comments

The event is fired on using the addItem method and on adding tabs using a special tab that contains the plus sign +.

Example

To execute the example, connect the PP.js components library and the PP.css visual styles table. Create the TabControl component. Add a handler for the AfterAddItem event:

    //Create TabControl component:
    var tabcontrol = new PP.Ui.TabControl({
            //ID for the div tag
            ParentNode: document.getElementById("tabcont1"),
            Width: 300,
            Height: 200,
            //Path to the icons folder:
            ImagePath: "img"
        });
    //Add a tab to the TabControl component:
    tabcontrol.addItem(new PP.Ui.TabItem({ Position: PP.LTRB.Top, Caption: "Tab"}));
    //Add the AfterAddItem event handler:
    tabcontrol.AfterAddItem.add(onAfterAddItem);
    //AfterAddItem event handler:
    function onAfterAddItem(sender, args) {
        alert("Tab " + args.Item.getCaption() + " is added");
    }

After executing the example the TabControl component is positioned on the HTML page. After adding a new tab the message "Tab (sequence number) is added" is displayed to the screen.

See also:

TabControl