shapeIconClick

fires on clicking a toolbar icon

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

Parameters

idstring|numberthe id of the icon

Example

var diagram = new dhx.Diagram("diagram_container", { 
    toolbar: [
      {
        id:"download",
        content:"<i class='zmdi zmdi-download'></i>"
      },
      {
        id:"info",
        content:"<i class='zmdi zmdi-info-outline'></i>"
      }
    ]
});
 
diagram.events.on("shapeIconClick", function(icon){
    var id = diagram.selection.getId();
    alert(icon + " was clicked for id = " + id);
});
 
// For editor
editor.diagram.events.on("shapeIconClick", function(icon){
    var id = editor.diagram.selection.getId();
    alert(icon + " was clicked for id = " + id);
});

See also
Back to top