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 User 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
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Posting Permissions

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