Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-885 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

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

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

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Looks like a bug, thank you for the report.

  3. #3
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    474
    Vote Rating
    1
    johnnywengluu is on a distinguished road

      0  

    Default


    Yes I have the same issue.

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

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    No, the core problem is in the Data package. Be sure to set a root in the store config for now.

    Sencha Inc

    Jamie Avins

    @jamieavins

  5. #5
    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


    This has been fixed and will be part of the next Touch 2.0 release. Thanks for the reports!