We are trying out kendo to see if it meets our needs.
Using the Diagram control I have added a couple of shapes containing information that I don't want a user to remove or edit.
Can I
a. Disable deleting of certain shapes
b. Disable moving of certain shapes.
Thanks
3 Answers, 1 is accepted
0
Hristo Germanov
Telerik team
answered on 17 Dec 2014, 01:33 PM
Hello Shane,
1) If you override the shape.editable.tools with the tools that you need. If you set empty tools array the toolbar will not be visible.
2) Currently the you can't prevent the shapes from moving but you can add an UserVoice item for this request.
Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
If I wanted to use shape.editable.tools how would I disable the president item "dataItem.JobTitle === 'President'" from being deleted. All other shapes can be deleted however I don't want this shape to be removed.
Sorry but not following along with the documentation on how to achieve this.
0
Accepted
T. Tsonev
Telerik team
answered on 19 Dec 2014, 05:01 PM
Hello,
I see what you mean. We can set up this kind of restriction by setting the shape selectable flag.
This has to be done after the shapes are created: function onDataBound(e) {
// Wait until all shapes are created
setTimeout(function () {
// Disable selection (and modification) of specific shapes
$.each(e.sender.shapes, function() {
if (this.dataItem.JobTitle === "President") {
this.options.selectable = false;
}
});
}, 0);
}
I've prepared a snippet to demonstrate.
I hope this helps.
Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!