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 shapes by the attribute key
var shapes = diagram.data.findAll({by:"text",match:"Manager"});
 
//searching for shapes by the function
var shapes = diagram.data.findAll(function(shapes){
    if(shapes.text==="Manager"||shapes.text==="Marketer"){return true}
});

See also
Back to top