Results 1 to 3 of 3

Thread: Ext Js how to change the xtype dynamically

  1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    7
    Vote Rating
    1
      0  

    Default Ext Js how to change the xtype dynamically

    Hi,

    I have a border layout whose center panel is defined like the below.

    Code:
            {
               region:'center',
               id:'Center',
               layout:'fit',
               xtype:'gridA'
             }
    But on click of a button, I want to change the grid to 'gridB' through javascript programmatically. How can this be done.

    I tried the following with no success.

    Code:
        1) Ext.getCmp('Center').xtype = 'gridB';
    
        2) Ext.getCmp('Center').setxtype('gridB');
    
        3) Ext.getCmp('Center').items.add({xtype:'gridB'});
    Please suggest me the way through which this can be achieved.

    Thanks
    Sk

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

    Default

    Use card layout, and switch the activeItem between different items in tere.

  3. #3
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    86
      0  

    Default

    You don't set an xtype dynamically once an instance of a class has been derrived from the xtype!

Posting Permissions

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