BCList.findById

Syntax

findById (id);

Parameters

id. Element ID.

Description

findById finds an item in the collection by its ID.

Comments

Identifier is set using the Idproperty.

Example

To execute the example, on HTML page in the HEAD tag, add links to the PP.js components library and to PP.css visual styles. Create the Breadcrumb component:

    var bread = new PP.Ui.Breadcrumb({

        ParentNode: document.getElementById("bc1"),

        Width: 400,

        Items:

         [

            { Content: "Element1", Id: "el1" },

            { Content: "Element2", Id: "el2" },

            { Content: "Element3", Id: "el3" }

          ]

        });

    var a = bread.getItems().findById("el1");

    console.log(a.getContent());

After executing the example the HTML page will contain the Breadcrumb component that includes three child items. Name of the item with the ID "el1 - Element1" is displayed in the browser console.

See also:

BCList