In my project , i was form some shape with connections during drag event in kendo Diagram(refer image 1).then press ctrl+z ,last formed connection will loss(refer image 2).
so i need to stop this undo and redo service.
How to stop these service in kendo diagram using jquery or javascript ?
8 Answers, 1 is accepted
While you create the shapes and the connections you can specify through the undoable parameter whether or not to add the objects in the undo stack. More information could be found in the following help article:
Hope this helps.
Regards,
Konstantin Dikov
Telerik
Hi Konstantin Dikov ,
Undoable is not working . I am using this code for add new shape [diagram.addShape(new Point(100, 100)).options.undoable=false] .After that i press Ctrl + Z ,added image is removed . but here also undoable is not working
Hi Konstantin Dikov ,
Any Undo and Redo events available in kendo diagram ?
Specific events for undo and redo are not currently available.
As for the issue with the addShape method - the parameter should be passed to the method in order to be taken into account e.g.
diagram.addShape({x: 100, y: 100},
false
);
Regards,
Daniel
Telerik
Hi Admin ,
Good Evening .Undo is not working when drop the shapes.This is enough only dragging shapes.But Undo is working when use this below code .
diagram.connect(diagram.addShape({x: 100, y: 100}, false),diagram.addShape({x: 200, y: 000},false));
this is correct or not ?
And then i need to stop undo loading shapes also . i am using diagram.load() function for load diagram .
Please send idea for those below 2 issues
1 .Undo is working when connect 2 shapes .
2.undo is working when diagram.load() function.
As I have mentioned in my previous post, there are no "Undo" or "Redo" events and setting the undoable property is the only option for disabling that functionality. Please note that the undoable is applicable for the creation of the shapes and connection and not for the dragging:
I could however suggest that you try to handle the onkeydown event for example for the document and prevent its propagation if CTRL+Z is pressed, but I could not confirm that it will work in the context of the Diagram.
Regards,
Konstantin Dikov
Telerik
Hi Admin ,
1.Am using diagram.connect for connect two shapes [refer the below code].but undo is stop only shapes not connection.This code is correct or not ?
diagram.connect(diagram.addShape(new Point(100, 100),false),diagram.addShape(new Point(300, 100),false),false);
2.I catch the Ctrl + z press using jquery ,after that using this code e._defaultPrevented = true for stop that undo event .this is also correct or not ?
please send sample code for that 2 questions .
The undoable option is not available when you connect shapes through the "connect" method. You can however use the undoable with addConnection method:
As for preventing jQuery events, you need to use the preventDefault() method:
Regards,
Konstantin Dikov
Telerik