HI,
In this sample code i try to delete shape by remove item from diagram datasource,
but after the delete the 2 shapes remain in the diagram and in the datasource only 1.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Kendo UI Snippet</title>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.silver.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css"/>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
</head>
<body>
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
dataSource: [{
"name": "Telerik",
"items": [
{"name": "Kendo"},
{"name": "Icenium"}
]
}],
template: "#= item.name #",
autoBind: false
});
// Fetching data will trigger "change" on the dataSource
$("#diagram").getKendoDiagram().dataSource.fetch();
var datasource = $("#diagram").getKendoDiagram().dataSource.data()[0];
alert(datasource.items.length); //2
$("#diagram").getKendoDiagram().dataSource.remove(datasource.items[0]);
alert(datasource.items.length); //1
</script>
</body>
</html>