Stop Undo and Redo service in Kendo Diagram

9 posts, 2 answers
  1. naga
    naga avatar
    8 posts
    Member since:
    Apr 2016

    Posted 11 Apr Link to this post

      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 ?
  2. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1803 posts

    Posted 12 Apr Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. naga
    naga avatar
    8 posts
    Member since:
    Apr 2016

    Posted 22 Apr Link to this post

    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

  5. naga
    naga avatar
    8 posts
    Member since:
    Apr 2016

    Posted 23 Apr in reply to naga Link to this post

    Hi Konstantin Dikov ,

               Any  Undo  and Redo  events available in kendo diagram ? 

     

  6. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 26 Apr Link to this post

    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!
     
  7. naga
    naga avatar
    8 posts
    Member since:
    Apr 2016

    Posted 26 Apr in reply to Daniel Link to this post

    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.

  8. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1803 posts

    Posted 28 Apr Link to this post

    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!
     
  9. naga
    naga avatar
    8 posts
    Member since:
    Apr 2016

    Posted 29 Apr Link to this post

    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  .

  10. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1803 posts

    Posted 03 May Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready