NavigationItem.Toggling

Syntax

Toggling: function(sender,args)

Parameters

sender. Event source.

args. Event information.

Description

The Toggling event is occurs on expanding or collapsing a tab.

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 Toggling 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).Toggling.add(function (sender, args) {//handler for the Toggling event:

        NB.getItem(1).setEnabled(false);

    });

</script>

After executing the example on expanding the first tab panel the second tab becomes unavailable for the user.

See also:

NavigationItem