1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
    rafcia007 is on a distinguished road

      0  

    Default Unanswered: initialize: function not showing in the log? No shows a list of nestedlist - no load

    Unanswered: initialize: function not showing in the log? No shows a list of nestedlist - no load


    Below is a sample code..and when you start the program there was no error, but the list is not loaded into nestedlist

    Code:
    Ext.define('Sencha.view.Webaxis', {
    extend: 'Ext.tab.Panel',
    xtype: 'webaxis',
    id : 'q4webMain',
     requires : [
            'Ext.TitleBar',
            'Ext.data.TreeStore',
            'Ext.dataview.NestedList',
            'Ext.data.Model',
            'Sencha.model.MenuItem'  // 
            ],
    
                config: {
                title: 'YMS Axis 2',
                   iconCls: 'home',
                layout: 'fit',
                    items: [
                    {
                    xtype: 'nestedlist',
                    autoload: true,    
                    id : 'menuListConteiner',
                    title : 'Show lists',
                    displayField: 'text',
                       store: {
                        model: 'Sencha.model.MenuItem',
                        defaultRootProperty: 'items',
                        root: {
                            text:'MENU',
                                   items:[
                                       {
                                id:'loading',
                                text:'ŁADOWANIE',
                                name:'loading',
                                icon:''
                                }
                                  ]
                            }, 
                    },  // no show log, why no loading data?  no refresh?
                    initialize: function() {
                    ... here code example
                         console.log('test ');// no show, why no loading data?
                    },    
                    getMenuCallback: function(json) {
                    var obj = Ext.getCmp('menuListConteiner');    
                    
                    var store = Ext.create('Ext.data.TreeStore', {
                    model: 'Sencha.model.MenuItem',
                    defaultRootProperty: 'items',
                    root: Ext.JSON.decode(json),
                    });
                obj.setStore(store);
                }
            }
            ]
            }     
    
    });

    Do you know how to solve the problem ?
    Last edited by rafcia007; 20 Mar 2013 at 12:40 PM. Reason: test

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,215
    Answers
    3517
    Vote Rating
    858
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    initialize is not a config, it's a method on the nestedlist. If you want to do something within the initialize method, then you need to extend the nestedlist.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.