1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    MrPurple is on a distinguished road

      0  

    Default viewport BorderLayout - change Ext.Panel on button click

    viewport BorderLayout - change Ext.Panel on button click


    Hi 2 all

    I need to change viewport layout contents after application is initialized (on button click for example)

    I have the code below

    Code:
    Ext.application({
        name: 'AM',
    
    ...
    
        controllers: [
            'Index',
        ],
    ...
        launch: function() {
            Ext.create('AM.view.Viewport', {
                id: 'viewport-main',
                renderTo : Ext.getBody(),            
                layout   : 'border',
                defaults : {
                split: true
                },
                items: [
                    {
                        xtype: 'index',
                        region: 'center',
                    },
                    Ext.createWidget('toolbar', {
                        region: 'south',
                        items : [
                            {
                                text: 'Change Panel',
                                handler: ...
                            },
                        ]
                    })
                ]
         }
    How can I change center region item in layout?

    I tried to use Ext.getcmp('viewport-main'), but can't get items and also think this is not correct way to work with contents in viewport.

    Could you help me?
    Thanks

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    37
    Vote Rating
    0
    cntx is on a distinguished road

      0  

    Default


    All items inside the Viewport are by default Ext.panel.Panel.
    In ur case, its a 'index' xtype.
    Just give them an unique id then u can get them using
    Code:
    Ext.getCmp(id);
    or better, u can then select them using
    Code:
    Ext.ComponentQuery.query('viewport > index[id="your id"]');
    By using ComponentQuery u can select component by their xtype and do some filtering according to some attributes. Just read the API for ComponentQuery for more information.

    greets

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    MrPurple is on a distinguished road

      0  

    Default


    Quote Originally Posted by cntx View Post
    All items inside the Viewport are by default Ext.panel.Panel.
    In ur case, its a 'index' xtype.
    Just give them an unique id then u can get them using
    Code:
    Ext.getCmp(id);
    or better, u can then select them using
    Code:
    Ext.ComponentQuery.query('viewport > index[id="your id"]');
    By using ComponentQuery u can select component by their xtype and do some filtering according to some attributes. Just read the API for ComponentQuery for more information.

    greets
    Thank you

Similar Threads

  1. Howto: button click in tbar for change position or toggle panel items
    By elsendoorn in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 2 Feb 2010, 7:36 AM
  2. who caan teach me how i change the visibility after click button?
    By dannyg in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 3 Dec 2009, 5:26 PM
  3. change button background color on click
    By huhulucy90 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 26 Oct 2009, 5:01 PM
  4. Replies: 3
    Last Post: 25 Jun 2008, 11:01 AM
  5. Question about a BorderLayout viewport contains a nested BorderLayout panel
    By VinceChen in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 19 May 2008, 7:28 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar