Edit this page

shapeDefaults.editable Boolean |Object (default: true)

Defines the shape editable options.

shapeDefaults.editable.connect Boolean (default: true)

Specifies whether the connectors appear on hover.

shapeDefaults.editable.drag Boolean (default: true)

Specifies if the shapes can be dragged.

shapeDefaults.editable.remove Boolean (default: true)

Specifies if the shapes can be removed.

shapeDefaults.editable.tools Array

Specifies the toolbar tools. Provides all options that are supported for toolbar.items. The predefined tools are:

  • "edit" - The selected item can be edited.
  • "delete" - The selected items can be deleted.
  • "rotateClockwise" - The selected items can be rotated clockwise. The default rotation value is 90 degree.
  • "rotateAnticlockwise" - The selected items can be rotated anticlockwise. The default rotation value is 90 degree.

Example - using predefined tools

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    shapes: [{}],
    shapeDefaults: {
      editable: {
        tools: [{
          name: "delete"
        }, {
          name: "rotateClockwise"
        }, {
          name: "rotateAnticlockwise"
        }]
      }
    }
  });
</script>

Example - using custom tools

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    shapes: [{}],
    shapeDefaults: {
      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>

shapeDefaults.editable.tools.name String

The name of the tool. The built-in tools are edit, delete, rotateClockwise, and rotateAnticlockwise.

shapeDefaults.editable.tools.step Number (default: 90)

The step of the rotateClockwise and rotateAnticlockwise tools.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy