-
15 Oct 2011 6:46 PM #1
[PR 1] TreeStore autoloading & loading twice (autoload set to false)
[PR 1] TreeStore autoloading & loading twice (autoload set to false)
[PR1]: Sorry couldn't edit thread and put it in the title.
Outside of the app.js & the navigation model, This is the whole app. There are two 'nav store loading' entries & two 'nav stored loaded' entries in my console (notice the console.log statements in the controller). I am trying to find what is causing it to fire again (or the first time for that matter since autoLoad : false) but I thought I would bring this up.
Code:Ext.define('Ace.controller.Main', { extend: 'Ext.app.Controller', config: { }, views : [ 'Main' ], stores: [ 'Navigation' ], refs: [ { ref : 'toolbar', selector: '#mainNavigationBar' }, { ref : 'navigation', selector: '#mainNestedList' } ], init: function() { this.control({ '#mainNestedList': { back: this.onBack } }); this.getNavigationStore().on({ scope: this, load : this.onNavStoreLoad, beforeload: this.onPreNavLoad }); }, onPreNavLoad : function(store, node, records, success, eOpts) { console.log('nav store loading'); }, onNavStoreLoad: function(store, node, records, success, eOpts) { console.log('nav store loaded'); }, onBack: function() { this.getSourceButton().setHidden(true); }
Code:Ext.define('Ace.view.Main', { extend: 'Ext.Container', requires: [ 'Ext.dataview.NestedList', 'Ext.NavigationBar' ], config: { fullscreen: true, layout : { type: 'card', animation: { type: 'slide', direction: 'left', duration: 250 } }, items: [{ id : 'launchscreen', cls : 'launchscreen', html: '<div><p>SOME TEXT</p></div>' }, { id : 'mainNestedList', xtype : 'nestedlist', title : 'Menu', useTitleAsBackText : false, docked : 'left', width : 250, store : 'Navigation', displayField : 'text' }, { id : 'mainNavigationBar', xtype : 'navigationbar', docked : 'top', title : 'TEST APP' }] } });
Navigation URL returns a JSON array with two entries in it. The /navigation/ URL is called twice, and there are 4 menu items (two of each)Code:Ext.define('Ace.store.Navigation', { extend : 'Ext.data.TreeStore', alias : 'widget.navstore', model : 'Navigation', autoLoad : false, proxy: { type : 'ajax', url : '/navigation/', reader: { type : 'json', root : 'items' } } });
-
17 Oct 2011 8:57 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Looks like a bug, thank you for the report.
-
13 Nov 2011 9:56 PM #3
Yes I have the same issue.
This wasn't fixed in the latest PR2 release I guess?
-
14 Nov 2011 9:39 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
No, the core problem is in the Data package. Be sure to set a root in the store config for now.
-
16 Dec 2011 12:43 PM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 5
This has been fixed and will be part of the next Touch 2.0 release. Thanks for the reports!
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-885
in
2.0.


Reply With Quote
