contains (item);
item. Item to find.
The contains method determines whether the collection includes the specified item.
The method gets True value if the collection contains this item. Otherwise the method gets False.
To execute the example create the Breadcrumb component with "bread" name and a button with the CheckIndex label.
var b1 = new PP.Ui.Button({ ParentNode: "b1", Content: "CheckIndex" });
b1.Click.add(function (sender, args){
if (bread.getItems().contains(item1)== true)
{
alert(bread.getItems().indexOf(item1));
}
});
After executing the example clicking the button shows a message that contains index of the item1 item to the screen, if this item is available in the collection.
See also: