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