Results 1 to 5 of 5

Thread: panel.remove(item,false) => item does not disappear

  1. #1

    Default panel.remove(item,false) => item does not disappear

    Hello,

    I have a panel p2 which contains the panel p.
    Now I like to remove panel p, but I don't want to destroy it, because I need it in another component too.

    So i tried p2.remove(p, false); and doLayout but the panel p does not disappear.

    PHP Code:
    var = new Ext.Panel({
            
    title'My Panel',
            
    collapsible:true,
            
    renderTo'panel-basic',
            
    width:400,
            
    htmlExt.example.bogusMarkup
        
    });

        
    // preventBodyReset: true
        
    var p2 = new Ext.Panel({
            
    title'A Panel with W3C-suggested body-html styling',
            
    preventBodyResettrue,
            
    renderTo'panel-reset-true',
            
    width400,
            
    itemsp
        
    });

        
    p2.remove(pfalse);
        
    p2.doLayout(); 
    Thanks.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    You need to add it to a hidden "trashcan" Container, and then call trashcan.doLayout()

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

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

    Default

    You could also use:
    Code:
    p2.remove(p, false);
    p.hide();
    (but it depends on the layout of p2 if this will work correctly)

    You could also consider giving p2 a card layout and switch from p to another card.

  5. #5

    Default

    Quote Originally Posted by Animal View Post
    Thanks! Thats exactly what i need.

Posting Permissions

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