findAll

finds all the items that correspond to the specified parameters

array findAll(string|function by,string match);

Parameters

bystring|functionthe search criterion (either the key of the item attribute or a filtering function)
matchstringthe value of the item attribute

Returns

arrayan array of matching item objects

Example

//searching for items by the attribute key
var items = component.data.findAll({by:"text",match:"Manager"});
 
//searching for items by the function
var items = component.data.findAll(function(items){
    if(items.text==="Manager"||items.text==="Marketer"){return true}
});

Back to top