[CLOSED] Event for when drawing is finished

Threaded View

Previous Post Previous Post   Next Post Next Post
  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 10:59 AM. Reason: [CLOSED]

Similar Threads

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

Posting Permissions