insert

Inserts an element at the specified position.

Parameters

position Number

The position to insert the element at. Existing children beyond this position will be shifted right.

element kendo.drawing.Element

The element to insert.

Example

<div id="surface"></div>
<script>
    var draw = kendo.drawing;
    var group = new draw.Group();

    var pathA = new draw.Path().moveTo(0, 0).lineTo(100, 100);
    var pathB = new draw.Path().moveTo(0, 100).lineTo(100, 0);
    group.append(pathA, pathB);

    var circle = new draw.Circle(new kendo.geometry.Circle([50, 50], 25));
    group.insert(1, circle);

    console.log("Children count after insert:", group.children.length);
    console.log("Element at position 1:", group.children[1]);

    var surface = draw.Surface.create($("#surface"));
    surface.draw(group);
</script>
In this article
insert
Not finding the help you need?
Contact Support