NavigationBar.getItems

Syntax

getItems ();

Description

The getItems method returns tabs of the navigation panel.

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 navPanel that contains four tabs.

<script type="text/javascript">

var navPanel = new PP.Ui.NavigationBar({

    Width: 474,

    Height: 304,

    ParentNode: document.getElementById("example"),

    Items: [{ Title: "1" },

            { Title: "2" },

            { Title: "3" },

            { Title: "4"}] });

    alert("Title of the 2nd tab: " + navPanel.getItems()[1].getTitle());

    navPanel.getItems()[1].setTitle("New_2");

    alert("New title of the 2nd tab: " + navPanel.getItems()[1].getTitle());

    navPanel.getItems()[0].setContent("Content_For_1");

</script>

After executing the example the NavigationBar component that consists of four tabs is placed onto the HTML page. A message that contains the title of the second tab, then the new title of the second tab is displayed in the screen.

See also:

NavigationBar