Results 1 to 3 of 3

Thread: Initializing components inside constructors

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Answers
    10
    Vote Rating
    2
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Answers
    10
    Vote Rating
    2
      0  

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •