Results 1 to 6 of 6

Thread: Add/Remove Panels

  1. #1
    Sencha User lukefowell89's Avatar
    Join Date
    Nov 2010
    Location
    Dorset, UK
    Posts
    262

    Default Add/Remove Panels

    Just a quick question about adding and removing panels from a container. I have a combo box which when I select an item it adds the relevant panel to the container. The problem is that I can show all these panels once, but when selected a second time, they dont replace the current panel.

    Any ideas?
    My Web Design, Development & Internet Marketing Blog: http://www.aztec-online.com
    Read My Review of the latest Ext JS Framework:Ext JS 4 Review

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    When you remove a panel it is destroyed, so you can't add it again.

    I recommend using a container with layout:'card' and instead of adding/removing panels, just select the appropriate card.

  3. #3
    Sencha User lukefowell89's Avatar
    Join Date
    Nov 2010
    Location
    Dorset, UK
    Posts
    262

    Default

    Ah ok that sounds like a much better idea.

    I had set autoDestroy to false, so i thought it wouldnt be destroyed?
    My Web Design, Development & Internet Marketing Blog: http://www.aztec-online.com
    Read My Review of the latest Ext JS Framework:Ext JS 4 Review

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Yes, it won't get destroyed, but it also won't get removed from the DOM (only from the container). If you use autoDestroy:false then you need to move the DOM of a removed component somewhere else yourself.

  5. #5
    Sencha User lukefowell89's Avatar
    Join Date
    Nov 2010
    Location
    Dorset, UK
    Posts
    262

    Default

    For some reason when my button isnt showing up on my form when I display the panel? is there anything wrong with this?

    Code:
    new Ext.Button({
                    xtype: 'button',
                    text: 'Create Bar Chart',
                    style: {marginTop: '5px'}
                })
    My Web Design, Development & Internet Marketing Blog: http://www.aztec-online.com
    Read My Review of the latest Ext JS Framework:Ext JS 4 Review

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You are now using a layout:'card' container? In that case you might need to configure it with:
    Code:
    layoutConfig:{layoutOnCardChange:true}

Similar Threads

  1. Add/remove form panels to/from a center regional panel
    By webarts-pl in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 6 Dec 2010, 2:31 PM
  2. Dynamically add panels and sub panels into accordion panel
    By Toxa in forum Ext 3.x: Help & Discussion
    Replies: 10
    Last Post: 17 Dec 2009, 1:21 PM
  3. Replies: 1
    Last Post: 7 Nov 2007, 8:17 AM

Posting Permissions

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