Results 1 to 2 of 2

Thread: setActiveItem animations in conjunction with doLayout() call

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    79
    Answers
    7

    Default Answered: setActiveItem animations in conjunction with doLayout() call

    So I noticed a method that @mitchellsimoens uses to keep his app tidy. Essentially the idea is only retaining one item in the dom at a time. Using the activate and deactivate listeners to add data and remove previous cards as the user explores the app. You can find the example here http://www.sencha.com/forum/showthread.php?121964 warning: his example is on page 2 of the thread. This one got a bit lengthy.

    Moving on, its working great & I really like it. My current dilemma though is that because one item is being added to the view each time I think that may eliminate the option for a transition.

    For example if say I have a app with a wrapper panel called mainWrapper. This wrapper gets a loginView added to it. When user submits the login form, then login controller does its magic. It verifies the user creats and entry in a store. Once complete I call the following code to add the next view and set it as the active item.

    Code:
    			
    	mainWrapper.add(myApp.views.nextView);
    	mainWrapper.doLayout();
    	mainWrapper.setActiveItem(
            myApp.views.nextView, {type: 'slide',direction: 'left'}
    );

    This works fine the nextViews loads but it just pops into view with no animation. Which just doesn't look good at all. I have a feeling that the doLayout() is the culprit but i'm not 100% sure.

    I'm hoping to find a way to make this works as I would love to not store more in the dom than needed and my app will be fairly complex with many views.

    Anyone have any thoughts?

  2. I just realized I was setting the animation in the mainWrapper controller in a case setup where a user is already logged and forgetting to set it in the login controller when they loggin in the first time.

    This is what I get for staying up til 3AM and coding.

    Deepest apologies!

  3. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    79
    Answers
    7

    Default

    I just realized I was setting the animation in the mainWrapper controller in a case setup where a user is already logged and forgetting to set it in the login controller when they loggin in the first time.

    This is what I get for staying up til 3AM and coding.

    Deepest apologies!

Tags for this Thread

Posting Permissions

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