PDA

View Full Version : [FIXED] [PR 1] TreeStore autoloading & loading twice (autoload set to false)



hallikpapa
15 Oct 2011, 6:46 PM
[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.



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);
}



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'
}]
}
});




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'
}
}
});


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)

Jamie Avins
17 Oct 2011, 8:57 AM
Looks like a bug, thank you for the report.

johnnywengluu
13 Nov 2011, 9:56 PM
Yes I have the same issue.

This wasn't fixed in the latest PR2 release I guess?

Jamie Avins
14 Nov 2011, 9:39 AM
No, the core problem is in the Data package. Be sure to set a root in the store config for now.

TommyMaintz
16 Dec 2011, 12:43 PM
This has been fixed and will be part of the next Touch 2.0 release. Thanks for the reports!