remove

Removes one or more items from the diagram

Parameters

items Object|Array

A diagram item or an array of diagram items to remove.

undoable Boolean (default:true)

Whether the removal should be recorded in the undo-redo stack.

Example - removing items

<button id="removeBtn">Remove</button>
<div id="diagram"></div>
<script>
  $("#removeBtn").on("click", function(){
    var diagram = $("#diagram").getKendoDiagram();
    if(diagram.shapes.length > 0){
      diagram.remove(diagram.shapes[0]);
    }
  });
  $("#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"
      }
    ]
  });
</script>
In this article
Not finding the help you need? Improve this article