findAll

finds all the shapes that correspond to the specified parameters

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

Parameters

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

Returns

arrayan array of matching shape 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