Results 1 to 3 of 3

Thread: Quick question on Component.render

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25
    Vote Rating
    88
      0  

    Default Answered: Quick question on Component.render

    Hi guys,

    Getting confused with this.render in the context of a controller (oops typo in the topic title, meant controller.render()).

    My understanding was that on a controller, calling:
    Code:
    this.render({
    xtype: 'myviewxtype'
    });
    would create a new instance of the component of that xtype, and then add it to the render target of the controller as an item.

    If it's not doing this, what does this.render do exactly? I've read somewhere that it's not compatible with a card layout. What if I need to use a card layout (am using a TabPanel) - how do I add items to that TabPanel from my controller if this.render doesn't do that?

    Many thanks

  2. I would just do tabpanel.add({ xtype : '...' }) or tabpanel.setActiveItem({ xtype : '...' }), I have never used this.render as I don't see a need for it.

  3. #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

    I would just do tabpanel.add({ xtype : '...' }) or tabpanel.setActiveItem({ xtype : '...' }), I have never used this.render as I don't see a need for 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

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25
    Vote Rating
    88
      0  

    Default

    Thanks Mitchell, that's what I'd defaulted to for the time being. I'd seen it in a few tutorials so was afraid that it was best practice that I needed to use...

Posting Permissions

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