1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Answers
    4
    Vote Rating
    0
    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
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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
    ________________
    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 in print!

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

Thread Participants: 1