Layout finished event?

3 posts, 1 answers
  1. Itai
    Itai avatar
    34 posts
    Member since:
    Feb 2016

    Posted 20 Jul 2016 Link to this post

    The diagram `layout` method returns immediately while the layout process is on-going in the background.

    It would be nice to have some way of knowing when the layout is finished, so I can show the user a "waiting" or "working" indication in the meanwhile. 

    I couldn't find any `onLayoutFinished` in the API docs. Is there a way to know if the layout has finished processing? 


    Thank you. 

  2. Answer
    Ianko avatar
    1729 posts

    Posted 21 Jul 2016 Link to this post

    Hello Itai,

    I am afraid there is no such event, neither there is a possible built-in approach to handle this case. You can request such an improvement here:

    Possible solution is to use an internal property that serves as a flag during Diagram processing the layout and an interval that fires your animation. Like so:
    var diagram = $("#diagram").getKendoDiagram();
      type: "tree",
      subtype: "radial",
      verticalSeparation: 200,
      radialSeparation: 300,
      startRadialAngle: 20,
    interval = setInterval(function(){
      // start animation
    }, 15);

    With the Diagram I used I was unable to experience so long delay for the layout to redraw itself. But I guess that you have great amount of shapes and connections that might cause a longer delay.

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. Itai
    Itai avatar
    34 posts
    Member since:
    Feb 2016

    Posted 23 Jul 2016 in reply to Ianko Link to this post

    Thank you, this solution seems to be enough for my needs.  


    Yes, the diagram has a few hundred nodes, and about as many connections. The problem is also most notable on slower machines, which is understandable. 

Back to Top