Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,695
    Vote Rating
    114
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default Ext.layout.Card -> setActiveItem

    Ext.layout.Card -> setActiveItem


    this method was really powerful in ST 1, since it had a second param that was not documented:

    Code:
        /**
         * Sets the active (visible) item in the layout.
         * @param {String/Number} item The string component id or numeric index of the item to activate
         */
        setActiveItem: function(newCard, animation) {
    this allowed to use different animations for setting the active card in an easy way.
    i used it a lot, since depending on the card where you are you want to modifiy the direction (e.g. slideOut left VS slideOut right).

    i _really_ hope you will bring this back. updateAnimation() for the whole layout is definitely not enough.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    The Card layout in ST2 automatically reverses the direction based on the index of the card. We want to avoid having second "animation" arguments to these types of functions.

    Any reason updateAnimation is not sufficient?

  3. #3
    Sencha Premium Member tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,695
    Vote Rating
    114
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    hi tommy,

    to keep the dom small, i often remove and add cards.
    your approach makes sense for tabpanels, but for custom ui design, it was awesome to change the animations just for the transition you want.

    +1 for bringing it back
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Ok, I'll add this as a ticket so that we can discuss this internally and see what we can do

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    justinKohactive is on a distinguished road

      0  

    Default I run everything through a viewport.

    I run everything through a viewport.


    all my views are in a viewport and when i switch between cards i proxy it though a reveal function. Below seems the accomplish exactly what I personally was looking for
    Code:
    reveal: function(target, animation) {
                 
                 var anim = {type: 'flip'};
                 if (animation) {
                     anim = animation;
                 }
                 var tview = this.views[target];
                 this.getLayout().setAnimation(anim);
         
                 this.setActiveItem(tview);
                
        }

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Thats a nifty little function justin, and might even be something we would want to add to the Viewport class itself. Great suggestion!

  7. #7
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    justinKohactive is on a distinguished road

      0  

    Default


    No problem,
    I'll keep posting my solutions and you can use them in Sencha, just hook me up with some passes to SenchaCon2011

  8. #8
    Sencha Premium Member tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,695
    Vote Rating
    114
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    i tried a similar approach, that is why i opened this ticket

    if we want to go this way, I think it is mandatory to set the animation back to its old value after setting the active item.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  9. #9
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    justinKohactive is on a distinguished road

      0  

    Default Like this?

    Like this?


    Code:
    reveal: function(target, animation) {
                 var origanim = this.getLayout().getAnimation();
                 var anim = origanim;
                 if (animation) {
                     anim = animation;
                 }
                 var tview = this.views[target];
                 this.getLayout().setAnimation(anim);
                 this.setActiveItem(tview);
                this.getLayout().setAnimation(origanim); 
        }
    This assumes the setActiveItem is a synchronous call.

  10. #10
    Ext Premium Member
    Join Date
    Sep 2009
    Posts
    48
    Vote Rating
    1
    yoh.suzuki is on a distinguished road

      0  

    Default


    Nice job! I like what you did there. I'm using a modified version of that now, passing in the target object instead of the index. Thanks for sharing.

    On a related note, if you are coming to this thread because you are migrating to Sencha Touch 2.0, you may run into the problem on Android phones where it will not respect the 'slide' animation's 'direction'.

    This is because in Android, it will use the 'scroll' animation automatically if you specify 'slide'. You can change the direction with 'reverse', but it doesn't respect 'direction'.