1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Vote Rating
    1
    Answers
    10
    umr.ashrf is on a distinguished road

      0  

    Default Unanswered: Initializing components inside constructors

    Unanswered: Initializing components inside constructors


    Here's my code of an test app which doesn't work as expected.

    http://www.senchafiddle.com/#ZCAbc

    What am I doing here is creating components inside component's constructor and adding them to the component. I am doing this because I don't like to assign every component a xtype and solely want to use Ext.create function for this purpose. What am I doing wrong here?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    873
    Answers
    3567
    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


    You should use the config object more. If you create a new class I would highly suggest giving it an xtype as ComponentQuery can be used to resolve it.
    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.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Vote Rating
    1
    Answers
    10
    umr.ashrf is on a distinguished road

      0  

    Default


    This is doable but what if I want to create objects and then add it to the items? Isn't it possible?

Thread Participants: 1