Results 1 to 3 of 3

Thread: How to replace one panel by another in Ext.Windows

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    6
    Vote Rating
    0
      0  

    Default How to replace one panel by another in Ext.Windows

    Hi SenchaI have two panels QryInfoPnl1 and QryInfoPnl2. I am adding QryInfoPnl1 in Ext.Windows items by default. but i want to replace panel1 by panel2 on the button event which is present in the Ext.Windows.I want to see the panel2 on the button click.I am trying below properties for replacing but i am getting the error:winShowAddQryInfo.removeAll();winShowAddQryInfo.add(QryInfoPnl2);winShowAddQryInfo.doLayout();Please helpPlease help
    Last edited by pawan_chand; 28 Aug 2012 at 1:48 AM. Reason: Editing Panels names

  2. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    93
      0  

    Default

    Hi,


    Try following code:

    Code:
    var win=Ext.create('Ext.window.Window', {
        title: 'Hello',
        height: 200,
        width: 400,
        layout: 'form',
        bbar:[{
            text:'changePanel'
            , scope:this
            , handler:function(btn){
                win.remove('panel1');
            	win.add(new Ext.panel.Panel({
                	title:'Panel2'
                    , html:'Hi'
                    , height:100
                    , collapsible:true
                }))
            }
        }],
        items: {
            xtype:'panel'
            , html:'Hello World!'
            , title:'Panel1'
            , id:'panel1'
            , height:100
            , collapsible:true
        }
    }).show();
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    Also consider using a Card layout on your Window, if you have need to switch back and forth between the two child panels.

Posting Permissions

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