BeforeSelect

fires on selecting a shape, but before the shape is really selected

void BeforeSelect(string|number id){ ... };

Parameters

idstring|numberthe shape id

Example

var diagram = new dhx.Diagram("diagram_container", { 
    type: "org", 
    select: true        
});
 
diagram.events.on("BeforeSelect", function(id) {
    console.log("Selecting " + diagram.data.getItem(id).text);
    return true;
});

Related samples

Details

Returning false from the handler will block the selection.

See also
Back to top