1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    1
    dhennen is on a distinguished road

      0  

    Default Unanswered: Temporarily disable animations in navigation view

    Unanswered: Temporarily disable animations in navigation view


    When I start up my app, or if a user is jumping forward or backwards many pages, I want to temporarily disable navigation view animations.

    I tried the following:

    PHP Code:
    Ext.define("myapp.view.Main", {    
      
    extend'Ext.navigation.View',   
      
    xtype:  'mainpanel',    config: {
            
    fullscreentrue,
            
    autoDestroyfalse,
            
    // start with animations disabled for startup, will re-enable later
            
    layout: {
              
    type'card',
              
    animationfalse
            
    }
        },
        
    enableAnimations: function() {
          
    this.getLayout().setAnimation({
            
    duration300,
            
    easing'ease-out',
            
    type'slide',
            
    direction'left'
          
    });
        },
        
    disableAnimations: function() {
          
    this.getLayout().setAnimation(false);
        }
    }); 
    I call enableAnimations() or disableAnimations() as needed before pop() and push(). The title bar will animate, but my view content will not, and in fact will some times not display at all.

    Any thoughts on how to accomplish this?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The navigation bar doesn't use animation from the layout. You need to change the animation property of the navigation bar using the setAnimation method on it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    1
    dhennen is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    The navigation bar doesn't use animation from the layout. You need to change the animation property of the navigation bar using the setAnimation method on it.
    That is good to know.

    However, that doesn't solve my main issue in that if I disable animations on the navigation view's layout and then re-enable them, the animations do not work, and sometimes even content doesn't display at all.

Thread Participants: 1

Tags for this Thread