New to Kendo UI for jQueryStart a free 30-day trial

Defines the editing behavior of the connections.

Default: true

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    dataSource: [
      {id:"one", name:"One"},
      {id:"two", name:"Two"},
      {id:"five", name:"Five"},
    ],
    connectionsDataSource:[
      {from:"one", to:"two", label: "plus one"},
      {from:"one", to:"five", label: "plus three"}
    ],
    layout: "layered",
    connectionDefaults: {
      content: {
        template: "#: dataItem.label #"
      },
      editable: false
    }
  });
</script>

Specifies if the connections can be dragged.

Default: true

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    connectionDefaults: {
        editable: {
            drag: false
        }
    },
    shapes: [
        { id: "1", x: 100, y: 100, content: { text: "Shape 1" } },
        { id: "2", x: 300, y: 100, content: { text: "Shape 2" } }
    ],
    connections: [
        { from: "1", to: "2" }
    ]
});
</script>

Specifies whether the connection path can be reshaped by the user. When enabled, dragging a connection handle adds or updates connection points to reflect the new route. User-defined points are shown as hollow circular markers and can be removed by double-clicking them.

Default: true

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    connectionDefaults: {
        editable: {
            points: false
        }
    },
    shapes: [
        { id: "1", x: 100, y: 100, content: { text: "Shape 1" } },
        { id: "2", x: 300, y: 200, content: { text: "Shape 2" } }
    ],
    connections: [
        { from: "1", to: "2" }
    ]
});
</script>

Specifies if the connections can be removed.

Default: true

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    connectionDefaults: {
        editable: {
            remove: false
        }
    },
    shapes: [
        { id: "1", x: 100, y: 100, content: { text: "Shape 1" } },
        { id: "2", x: 300, y: 100, content: { text: "Shape 2" } }
    ],
    connections: [
        { from: "1", to: "2" }
    ]
});
</script>

Specifies the toolbar tools. Supports all options supported for the toolbar.items. If set to false, no edit tools will be displayed.

Predefined tools are:

  • "edit" - The selected item can be edited
  • "delete" - The selected items can be deleted
<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    dataSource: [
      {id:"one", name:"One"},
      {id:"two", name:"Two"},
      {id:"five", name:"Five"},
    ],
    connectionsDataSource:[
      {from:"one", to:"two", label: "plus one"},
      {from:"one", to:"five", label: "plus three"}
    ],
    layout: "layered",
    connectionDefaults: {
      content: {
        template: "#: dataItem.label #"
      },
      editable: {
      	tools: ["delete"]
      }
    }
  });
</script>
<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    dataSource: [
      {id:"one", name:"One"},
      {id:"two", name:"Two"},
      {id:"five", name:"Five"},
    ],
    connectionsDataSource:[
      {from:"one", to:"two", label: "plus one"},
      {from:"one", to:"five", label: "plus three"}
    ],
    layout: "layered",
    connectionDefaults: {
      editable: {
        tools: [{
          type: "button",
          text: "Set Content",
          click: function() {
            var selected = $("#diagram").getKendoDiagram().select();
            var content = $("#content").val();
            for (var idx = 0; idx < selected.length; idx++) {
              selected[idx].content(content);
            }
          }
        }, {
          template: "<input id='content' class='k-textbox' value='Foo' />"
        }]
      }
    }
  });
</script>