connections.editable Boolean|Object (default: true)

Defines the shape editable options.

Example - enabling only deletion for a connection

<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: 300,
        y: 20
      }
    ],
    connections:[
      {
        from: "1",
        to: "2",
        content: {
          text: "Step 1"
        },
        editable: {
          tools: ["delete"]
        }
      }
    ]
  });
</script>

connections.editable.tools Array

Specifies the the toolbar tools. Supports all options supported for the toolbar.items. Predefined tools are:

  • "edit" - The selected item can be edited
  • "delete" - The selected items can be deleted

Example - showing custom tool for connection

<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: 300,
        y: 20
      }
    ],
    connections:[
      {
        from: "1",
        to: "2",
        content: {
          text: "Step 1"
        },
        editable: {
          tools: [
            { type: "button", id: "1", text: "Info", icon: "info", click: showMoreInfo },
          ]
        }
      }
    ]
  });

  function showMoreInfo(e){
    console.log("Clicked custom tool with id: " + e.id);
  }
</script>

connections.editable.tools.name String

The name of the tool. The built-in tools are "edit" and "delete".

In this article
Not finding the help you need?