This is a migrated thread and some comments may be shown as answers.

Stop Undo and Redo service in Kendo Diagram

8 Answers 199 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
naga
Top achievements
Rank 1
naga asked on 11 Apr 2016, 06:16 AM
  I need to stop undo and redo service (for prevent shapes and connections ) in kendo diagram using jquery or javascript  .
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

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 13 Apr 2016, 04:56 AM
Hi Naga,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
naga
Top achievements
Rank 1
answered on 22 Apr 2016, 07:26 AM

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

0
naga
Top achievements
Rank 1
answered on 23 Apr 2016, 07:05 AM

Hi Konstantin Dikov ,

           Any  Undo  and Redo  events available in kendo diagram ? 

 

0
Daniel
Telerik team
answered on 26 Apr 2016, 09:46 AM
Hello,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
naga
Top achievements
Rank 1
answered on 26 Apr 2016, 12:28 PM

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.

0
Accepted
Konstantin Dikov
Telerik team
answered on 28 Apr 2016, 08:03 AM
Hi Naga,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
naga
Top achievements
Rank 1
answered on 29 Apr 2016, 07:05 AM

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  .

0
Konstantin Dikov
Telerik team
answered on 03 May 2016, 07:50 AM
Hello Naga,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Diagram
Asked by
naga
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
naga
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or