Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:17:07+00:00 2026-05-19T03:17:07+00:00

I am starting to use Sencha Touch and have already read their Getting Started

  • 0

I am starting to use Sencha Touch and have already read their “Getting Started” gide, however I am currently stuck in what I want to do and haven’t been able to find any proper tutorial or example of what I need.

I want to make a panel so that when a user clicks on a specific button the panel slides and the toolbar on top disappears (or slides as well) and a new one appear just as it would happen on a native iOS app.

Here’s my Sencha code so far:

Ext.setup({
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    icon: 'icon.png',
    glossOnIcon: false,
    onReady: function() {

        /*HANDLERS
        *********************************************************************************/
        var showAlert = function(btn, event) {
            Ext.Msg.alert('Title', 'Diste ' + event.type + ' en el botón "' + btn.text + '"', Ext.emptyFn);
        };

        var tapHandler = function(button, event) {

        };

        /*BUTTONS
        *********************************************************************************/
        var aboutAppBtn = [{
            text: 'Sobre App',
            ui: 'round',
            handler: showAlert
        }];

        var checkInBtn = [{
            text: 'Check-in',
            ui: 'forward',
            handler: tapHandler
        }];

        var buscarCercaBtn = [{
            text: 'Buscar local...',
            ui: 'button',
            handler: showAlert
        }];

        var buttonsGroup1 = [{
            text: 'Sobre App',
            ui: 'round',
            handler: showAlert
        }, {
            text: 'Check-in',
            ui: 'forward',
            handler: tapHandler
        }];

        /*PHONE || SCREEN
        **********************************************************************************/
        if (Ext.is.Phone) {// Phone has far less screen real-estate
            var dockedItems = [{
                xtype: 'toolbar',
                dock : 'top',
                ui: 'light',
                title: 'My Toolbar',
                items: buttonsGroup1
            }];
        }else{
            //var dockedItems = [topTB];
            aboutAppBtn.push({xtype: 'spacer'});
            var dockedItems = [{
                xtype: 'toolbar',
                dock : 'top',
                ui: 'light',
                title: 'My Toolbar',
                items: aboutAppBtn.concat(checkInBtn)
            },{
                xtype: 'button',
                dock: 'bottom',
                ui: 'action',
                text: 'Buscar local...',
                handler: showAlert
            }];
        }

        var green = {
            style: 'background-color:#3b7E00; color:white;',
            title: 'Green',
            html: 'Green'
        };

        var blue = {
            style: 'background-color:#0F0; color:white;',
            title: 'Blue',
            html: 'Blue'
        };

        /*PANELS
        **********************************************************************************/
        var mainPanel = new Ext.Panel({
            dockedItems: dockedItems,
            layout: 'card',
            cardSwitchAnimation: {type: 'flip', duration: 500},
            fullscreen : true,
            items: [green, blue]
        });
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:17:08+00:00Added an answer on May 19, 2026 at 3:17 am

    To make the card transition when you click a button use the setActiveItem method in your handler:

    var tapHandler = function(button, event) {
        mainPanel.setActiveItem(1);
    };
    

    It can also take a reference to the panel component directly (which is useful if you ever change the order of the cards and the indices change).

    Your toolbar is docked to the outer container, not to the cards, so it won’t change when you change cards. You could dock two different toolbars to the card panels instead if you wanted it to change (or alter it programmatically, I suppose).

    Also you can use the ‘spacer’ type to spread your buttons apart to each side of the tool. Here is your code adjusted to do what I think you probably want (on phone only, for clarity)

    Ext.setup({
        onReady: function() {
    
            /*HANDLERS
            *********************************************************************************/
            var showAlert = function(btn, event) {
                Ext.Msg.alert('Title', 'Diste ' + event.type + ' en el botón "' + btn.text + '"', Ext.emptyFn);
            };
    
            var tapHandler = function(button, event) {
                mainPanel.setActiveItem(blue, {type: 'slide'});
            };
    
            var backHandler = function(button, event) {
                mainPanel.setActiveItem(green, {type: 'slide', direction: 'right'});
            };
    
    
            /*UI
            *********************************************************************************/
    
            var green = new Ext.Panel({
                dockedItems: [{
                    xtype: 'toolbar',
                    ui: 'light',
                    title: 'My Toolbar',
                    items: [{
                        text: 'Sobre App',
                        ui: 'round',
                        handler: showAlert
                    }, { xtype:'spacer'}, {
                        text: 'Check-in',
                        ui: 'forward',
                        handler: tapHandler
                    }]
                }],
                style: 'background-color:#3b7E3b',
                html: 'Green'
            });
    
            var blue = new Ext.Panel({
                dockedItems: [{
                    xtype: 'toolbar',
                    ui: 'light',
                    title: 'Check-in',
                    items: [{
                        text: 'Back',
                        ui: 'back',
                        handler: backHandler
                    }]
                }],
                style: 'background-color:#3b3b7E',
                html: 'Blue'
            });
    
            var mainPanel = new Ext.Panel({
                layout: 'card',
                fullscreen : true,
                items: [green, blue]
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are starting to use a Scrum process for development. We have a nice
I've done some Python but have just now starting to use Ruby I could
Just starting to use Ruby on Rails to see what its like. I have
We are starting to use nhibernate and have setup a Session Manager to create
I am just starting to use Subversion with Tortoise SVN client for one of
I'm just starting to use Django for a personal project. What are the pros
Although I played with it before, I'm finally starting to use Dvorak (Simplified) regularly.
Starting a new project and would like to use one of the MVC framworks.
When starting a new project that required the use of membership providers I found
What do search engine bots use as a starting point? Is it DNS look-up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.