Results 1 to 2 of 2

Thread: Make Buttons Switch Panels?

  1. #1

    Default Make Buttons Switch Panels?

    Hey everyone,
    I'm a student trying to learn more on sencha touch 1.1. As of right now I am having some difficulty understanding how to make my buttons go to another panel. I have seen many tutorials and examples on using a TabPanel and using that to switch panels, but I havent seen anything that will show me how to make a button, switch to a new panel.

    I have tried many things but if you could please give me some pointers that will lead me in the correct direction that would be most helpful.

    Thanks,
    SM.

    Code:
    ToolBarDemo.views.Homepage = Ext.extend(Ext.Panel, {         
        
        dockedItems: [{ 
            xtype: "toolbar", 
            title: "WELCOME TO GAME ON", 
            style: 'background: -webkit-linear-gradient(top, #818181, #1a1a1a)'
            }],
                
            layout:{                     
                type: 'vbox',             
                align: 'center,stretch' 
            },
            
            defaults:{                     
                xtype: 'button',
                  style: 'margin-top: 10px;'        
            },
            
            items: [{                 
                title: "Team Roster", 
                text: 'Team Roster',
                cls: 'teamroster',
                listeners: {
                    click:{
                        
                    }
                }
            
            },{
                title: "Todays game",            
                            text: 'Todays Game',
                cls: 'todaysgame',
    
    
            },{
                title: "Previous game", 
                text: 'Previous Game',
                cls: 'previousgame',
                
            },{
                title: "Stat Glossary", 
                text: 'Stat Glossary',
                cls: 'statglossary',
    
    
            }],        
        
    
    
        animation: 'slide',
        fullscreen: 'true',
        style: 'background: #000000'
        
        });    
        
    
    
    
    
    Ext.reg('homepage', ToolBarDemo.views.Homepage);

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    In the button handler, you should just use setActiveTab or setActiveItem on the tab panel or panel.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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