1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Hong Kong
    Posts
    44
    Vote Rating
    0
    Answers
    6
    Winnie Lam is on a distinguished road

      0  

    Default Unanswered: Unable to slide view in right direction

    Unanswered: Unable to slide view in right direction


    In app.js, I create a viewport with card layout.

    Code:
    Ext.application({
        name: 'App',  
        model: ['Page','ShopInfo'],
        controllers: ['Home'],    
        launch: function() {                  
            var viewport = Ext.create('Ext.Panel', {
                id: 'my-viewport',
                fullscreen: true,
                layout: {
                    type: 'card',
                    animation: { type: 'slide', direction: 'left' }
                },
                items: [
                    { xtype: 'home' }
                ]
    });
    
    
        }
    });
    And in the controller, whenever the button is clicked, i want it to go to the homepage.
    Please help with the following lines. Why the first one work, but the second one doesn't work? I want it slide to right. If I remove the animation type in app.js, nothing appeared.

    Code:
    'button[go]' : {
                    tap: function(btn) {
                        viewport = Ext.ComponentQuery.query('#my-viewport');
                        target = Ext.ComponentQuery.query(btn.go);
                        
                        viewport[0].getLayout().setAnimation({type: 'slide', direction: 'right'}); //first 
                        viewport[0].setActiveItem(target[0],{type: 'slide', direction: 'right'}); //second
                    }
                }

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    Answers
    93
    rdougan will become famous soon enough

      0  

    Default


    In PR2, setActiveItem does not support the second argument specifying the animation type.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 1

Tags for this Thread