-
24 Jul 2012 10:32 PM #1
NestedList animates backward in specific case
NestedList animates backward in specific case
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.1.1
- Chrome 20.0.1132.57
- 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.
- 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.
- Animation on the second item tap should pan the other way.
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.
- 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"
- only default ext-all.css
- Windows 7
-
25 Jul 2012 5:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
Thanks for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
27 Nov 2012 8:01 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 5
Thanks for the report! This has been fixed for the next release.
-
12 Feb 2013 9:21 AM #4
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:
.. out of its parent if clause and in between the lines 673 and 674 like so:Code:if (animation) { animation.setReverse(reverse); }
.. seems to fix this issue.Code:else { if (animation) { animation.setReverse(reverse); } if (firstList && secondList) {
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3174
in
Sprint 28.


Reply With Quote
