[CLOSED] Event for when drawing is finished

  1. #1

    [CLOSED] Event for when drawing is finished

    Is there an event I can subscribe to for when all drawing has finished?
    Right now I bind to Ext.onReady and also use setTimeout, to be sure all elements have been positioned. This is to add some custom shapes to the SVG object, I need to know the coordinates of some elements drawn by Ext.NET

    My (testing) code:
    <script type="text/javascript">
        Ext.onReady(function ()
        {
            window.setTimeout(function ()
            {
                var svg = document.getElementsByTagName("svg")[0];
                var bottom_axis = svg.getElementsByTagName("path")[0];
                var top_axis = svg.getElementsByTagName("path")[1];
    
                var bottom_left = bottom_axis.pathSegList.getItem(2);
                var bottom_right = bottom_axis.pathSegList.getItem(4);
                var top_left = top_axis.pathSegList.getItem(2);
                var top_right = top_axis.pathSegList.getItem(4);
    
                console.log(bottom_left);
                console.log(bottom_right);
                console.log(top_left);
                console.log(top_right);
    
                var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
                rect.setAttribute("fill", "red");
                rect.setAttribute("fill-opacity", "0.25");
                rect.setAttribute("x", top_left.x);
                rect.setAttribute("y", top_left.y);
                rect.setAttribute("width", top_right.x - top_left.x);
                rect.setAttribute("height", bottom_left.y - top_left.y);
                svg.appendChild(rect);
            }, 2000);
        });
    </script>
    Last edited by Daniil; Jun 20, 2012 at 11:59 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Is there an event I can subscribe to for when all drawing has finished?
    Do you mean charts or the whole page?

    Generally, there is no such event. Unfortunately, browsers doesn't provide such event in its API.

    For charts we can suggest to try the buffered AfterAnimate listener:
    http://forums.ext.net/showthread.php...ll=1#post82684

Similar Threads

  1. [CLOSED] Problem in vertical axes drawing in charts
    By feanor91 in forum 2.x Premium Help
    Replies: 13
    Last Post: Aug 27, 2012, 7:25 AM
  2. Replies: 1
    Last Post: Nov 12, 2011, 6:41 PM
  3. Replies: 2
    Last Post: Jun 16, 2011, 2:41 AM
  4. Replies: 1
    Last Post: Dec 22, 2010, 4:47 PM
  5. [CLOSED] How to wait until a DirectMethod is finished?
    By macap in forum 1.x Premium Help
    Replies: 2
    Last Post: Mar 31, 2010, 5:34 AM

Posting Permissions