Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1296
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •