[CLOSED] Guage not rendering when created in a panel that is craeted dynamically

  1. #1

    [CLOSED] Guage not rendering when created in a panel that is craeted dynamically

    We are using the following guage in my project

    http://jsgauge.googlecode.com/svn/tr...ple/gauge.html

    below is the implementation of the guage in our EXT project.

    excanvas.js and the gauge.js have been attached to the is thread. please rename the ext to .js. The guage renders propering in all the version of the browser .

    However, in IE 7 and IE 8 the dynamic guage does not render does not render and the statically declared panels renders in all scenerio. How can this issue be fixed.

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Dynamic>"%>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Header" runat="server">
        <title></title>    
        <meta content="NO-CACHE" http-equiv="CACHE-CONTROL" /> 
          <!--[if IE]><script src="/Scripts/jsgauge-0.4.3/excanvas.js" type="text/javascript"></script><![endif]-->
        <script src="/scripts/jquery-1.6.4.min.js" type="text/javascript"></script>          
        <script src="/Scripts/jsgauge-0.4.3/gauge.js" type="text/javascript"></script>
        <script src="/Scripts/Toolbox.js" type="text/javascript"></script>   
    
         <ext:ResourcePlaceHolder runat="server" />
           <%-- Override the default label seperator and set to ""--%>
           <script type="text/javascript">
               Ext.Component.prototype.labelSeparator = "";
        </script>
    </head>
    <body>
       
        <ext:ResourceManager  runat="server">
          
        </ext:ResourceManager>    
             
    
         <ext:Viewport runat="server" Layout="fit" IDMode="Explicit" >     
         <Items>         
            <ext:Panel  runat="server">
                <Items>
                    <ext:Panel runat="server">
                        <Content>                
                            <canvas id="guage1" width="250" height="250"></canvas>                   
                        </Content> 
                        <Listeners>
                            <AfterRender Handler="  new Gauge(document.getElementById('guage1'));"/>
                        </Listeners>
                    </ext:Panel>
                </Items>             
                <Listeners>
                    <AfterRender Handler="Common.UnMask();ToolBox.AddDynamicPanelWithGuage(item)"/> <------------ this does not render in IE7 and IE 8 but renders in all other browsers including IE 9
                </Listeners>
            </ext:Panel>
            </Items>
            </ext:Viewport>
    </body>
    </html>


    toolbox.js file
    ToolBox = {
        
        AddDynamicPanelWithGuage: function (item) {
    
            var panel = {
                title: 'Guage',
                html: '<canvas id="dynamic_guage" width="250" height="250"></canvas>',
                border: false,
                listeners: {
                    afterRender: function () {
                      
                            new Gauge(document.getElementById('dynamic_guage'));
                     
                    }
                }
            }
            item.addAndDoLayout(panel);
          
        }
    }
    Attached Files
    Last edited by Daniil; Apr 20, 2012 at 10:04 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Are there any errors?

    Please clarify the following statement:
    <!--[if  IE]><script src="/Scripts/jsgauge-0.4.3/excanvas.js"  type="text/javascript"></script><![endif]-->
    Is should stay commented for IE?

    Is the issue reproducible with the latest JQuery?
    Last edited by geoffrey.mcgill; Apr 19, 2012 at 7:32 PM.
  3. #3
    <!--[if IE]><script src="/Scripts/jsgauge-0.4.3/excanvas.js" type="text/javascript"></script><![endif]-->

    That is the way that the canvas is added to IE if not it will not even render at all. That is a fix for IE and it is correct the way it is. the comment is correct.

    This has nothing to do with the jquery you can take away the jquery script part.

    Where you able to reproduce it? did you try the code I sent to you?
  4. #4
    <!--[if IE]><script src="/Scripts/jsgauge-0.4.3/excanvas.js" type="text/javascript"></script><![endif]-->

    That is the way that the canvas is added to IE if not it will not even render at all. That is a fix for IE and it is correct the way it is. the comment is correct.

    This has nothing to do with the jquery you can take away the jquery script part.

    Where you able to reproduce it? did you try the code I sent to you?

    Remember it works when it is created declaratively but does not render when it is created dynamically using javascript.
  5. #5
    never mind. I have resolved the issue. has to do with canvas and the way it bahaves when it is rendered dyanamically.

Similar Threads

  1. [CLOSED] Tooltip With Dynamically created content
    By logicspeak in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 14, 2012, 1:55 PM
  2. Ext .net Menu Panel dynamically created
    By garag in forum 1.x Help
    Replies: 1
    Last Post: Oct 14, 2011, 9:50 AM
  3. [CLOSED] How to clean up dynamically created controls?
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 23, 2011, 9:51 AM
  4. Dynamically created panel content
    By reiben in forum 1.x Help
    Replies: 0
    Last Post: Jun 14, 2011, 7:07 AM
  5. [CLOSED] [1.0] Dynamically created control problem
    By galeb in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 19, 2010, 7:16 AM

Posting Permissions