remove

Fired when the user removes a shape or connection.

Event Data

e.connection kendo.dataviz.diagram.Connection

The connection that will be removed.

e.shape kendo.dataviz.diagram.Shape

The shape that will be removed.

e.preventDefault Function

Prevents the remove action. If called, the element will not be removed to the diagram.

e.sender kendo.dataviz.ui.Diagram

The widget instance which fired the event.

Example - handling the remove event

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    shapes:[
      {
        id:"1",
        content:{
          text: "State 1"
        },
        x: 20,
        y: 20
      },
      {
        id:"2",
        content: {
          text: "State 2"
        },
        x: 160,
        y: 20
      }
    ],
    connections:[
      {
        from: "1",
        to: "2"
      }
    ],
    remove: onRemove
  });

  function onRemove(e){
    if(e.shape){
      debugger
      console.log("Removing shape with text: " + e.shape.options.content.text);
    }

    if(e.connection){
      console.log("Removing connection with id: " + e.connection.id);
    }
  }
</script>
In this article
Not finding the help you need? Improve this article