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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,062
    Answers
    3976
    Vote Rating
    1391
      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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    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
  •