Results 1 to 2 of 2

Thread: Dynamically add panel to a card Layout

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Vote Rating

    Default Dynamically add panel to a card Layout

    I have a card layout which is configured on 1 tab within a tabPanel. This works fine if I have items:[] pre-configured and I can just call setActiveItem(index) to switch to the right card.

    Is there a way to add a panel to this card layout dynamically? For example, I need to load a specific "next" card depending on what button is tapped on the current card. Is this as easy as adding the panel to the items list? Do I need to reload or re-render anything?

    If there is a way to lazy-load (by default) the items in a card layout, that might be the ideal solution.

    Any takers?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    The setActiveItem can accept quite a few different types like a config object that will create the component, add the component and make it active in one call:

        xtype : 'form',
        items : [
            { xtype : 'textfield', label : 'Test' }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

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