NavigationItem.Toggled

Syntax

Toggled: function(sender,args)

Parameters

sender. Event source.

args. Event information.

Description

The Toggled event is occurs when expanding or collapsing a tab is completed.

Example

To execute the example enable the hyperlinks to the PP.js libraries and the table of the PP.css visual styles. Create a navigation panel named NB that has two tabs. Add a handler for the Toggled event.

<script type="text/javascript">

    var NB = new PP.Ui.NavigationBar({

        ParentNode: document.getElementById("NB1"),

        Width: 200,

        ShowBorders: true

    });

    NB.addItem(new PP.Ui.NavigationItem({ Content: "1", Title: "1" }));

    NB.addItem(new PP.Ui.NavigationItem({ Content: "2", Title: "2" }));

    NB.getItem(0).Toggled.add(function (sender, args) {//handler of the Toggled event

        NB.getItem(1).dispose();

    });

</script>

After executing the example a navigation bar with two tabs is placed to HTML page. Clicking the heading of the first tab expands the panel. After expanding the panel the second tab is deleted.

See also:

NavigationItem