Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3174 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    idmadj is on a distinguished road

      0  

    Default NestedList animates backward in specific case

    NestedList animates backward in specific case


    REQUIRED INFORMATION




    Ext version tested:
    • Sencha Touch 2.0.1.1
    Browser versions tested against:
    • Chrome 20.0.1132.57
    Description:
    • When a NestedList uses a store that contains both leaf and regular nodes at its root, and that a detail card is used for leaf nodes, the animation will be reversed when displaying a sublist after coming back from a detail card that was on the first level of the NestedList.
    Steps to reproduce the problem:
    • Using the code sample below, start the application;
    • Tap the first list entry;
    • Tap the back button;
    • Tap the second entry;
    • Animation will pan the wrong way;
    • Subsequent navigation will work properly.
    The result that was expected:
    • Animation on the second item tap should pan the other way.
    Test Case:


    Code:
    var data = {
        text: 'Items',
        items: [{
            text: 'First item',
            leaf: true
        }, 
        {
            text: 'Second item',
            items: [{
                text: 'First subitem',
                leaf: true
            },
            {
                text: 'Second subitem',
                leaf: true
            }]
        }]
     };
    
    
     Ext.define('ListItem', {
         extend: 'Ext.data.Model',
         config: {
             fields: [{
                 name: 'text',
                 type: 'string'
             }]
         }
     });
    
    
     var store = Ext.create('Ext.data.TreeStore', {
         model: 'ListItem',
         defaultRootProperty: 'items',
         root: data
     });
    
    
     var nestedList = Ext.create('Ext.NestedList', {
        fullscreen: true,
        title: 'Groceries',
        displayField: 'text',
        detailCard: {
            xtype: 'panel'
        },
        store: store
     });





    HELPFUL INFORMATION


    Debugging already done:
    • Animation is reversed when coming back from a detail card, but isn't "un-reversed" when only one list was created.
    Possible fix:
    • In NestedList.goToNode(), in the else block following "if (detailCardActive)", there are three conditions checking for lists existence. Adding the "if (animation)" block from the first block in the second block, right after "me.setLastActiveList(me.getActiveItem());" fixes the issue.
    • The parameter to the newly added "animation.setReverse();" can probably safely be set to "false" instead of "reverse"
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Windows 7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,824
    Vote Rating
    836
    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


    Thanks for the report.
    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
    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


    Thanks for the report! This has been fixed for the next release.

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Posts
    4
    Vote Rating
    0
    Max0n is on a distinguished road

      0  

    Default Still happening in 2.1.0

    Still happening in 2.1.0


    This Bug is still happening in version 2.1.0.

    It looks like the animation is only reversed after both lists (firstList & secondList) have been created. If the first list points to a leaf and you navigate back (which reverses the animation) the animation is still set to reverse when navigating into a node.

    Moving the if clause in NestedList.js lines 683-685:
    Code:
    if (animation) {
      animation.setReverse(reverse);
    }
    .. out of its parent if clause and in between the lines 673 and 674 like so:
    Code:
    else {
      if (animation) {
        animation.setReverse(reverse);
      }
    if (firstList && secondList) {
    .. seems to fix this issue.