1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    0
    Answers
    4
    clarose is on a distinguished road

      0  

    Default Unanswered: Draw component item disappears after a few seconds

    Unanswered: Draw component item disappears after a few seconds


    Hi,

    This might be a dumb question, but I'm starting out with Sencha Touch Charts 2 and I am running into the problem when I add "Ext.draw.Component" to a panel with two circles, like this:

    Code:
                initialize: function(c){
                    var drawComponent = new Ext.draw.Component({
                        items: [
                            {
                                type: 'circle',
                                fill: '#ffffff',
                                radius: 5,
                                x: 100,
                                y: 100
                            },
                            {
                                type: 'circle',
                                fill: '#ffffff',
                                radius: 5,
                                x: 120,
                                y: 100
                            }
                        ]
                    });
    
    
                    this.add(drawComponent);
    }
    The problem is that a few seconds after the circles are rendered, they simply disappear. I do not understand since it's not as if the panel is being refreshed or repainted or something of that nature, I do nothing at all with the app and the circles disappear.

    Any ideas ?

    Thanks in advance for your help

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    436
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    First thing that jumps out at me is you are overriding initialize method but not calling

    Code:
    this.callParent();
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.