Rick Hoving
Rick Hoving

Reputation: 3575

Nestedlist not showing store data when inside panel

I'm having a problem loading my nestedlist data when this list is shown inside of a panel. Here is my code:

    var titleBar = Ext.create("Ext.TitleBar", {
            id: 'mainNavigationBar',
            xtype : 'titlebar',
            layout: 'hbox',
            docked: 'top',
            title : 'cSenchaTitleBar',
            items:[
                {
                    xtype:"button",
                    text:"Menu",
                    align:"left",
                    listeners:{
                        tap: function(){
                             nestedListxx.showBy(this);
                        }
                    }
                },
            ]
        });


    var nestedList = 
        Ext.create('Ext.NestedList', {
            displayField: 'text',
            title:"cSenchaMenu",
            store: "oNavStore",
            id: 'mainNestedList',
            xtype : 'nestedlist',
            width:250,
            useTitleAsBackText: false,


         });
     var nestedListxx = Ext.create("Ext.Panel", {
         width:260,
        items:nestedList
    });

The problem is the following: Say that if I change nestedListxx.showBy(this); to nestedList.showBy(this); It works like a charm, only there are no sleek black borders around the nested list. But if I change it back it does show the nestedlist with the nice borders but without any data.

I know for sure that I forgot to set some key configuration, only the question is: which ones

Upvotes: 0

Views: 776

Answers (1)

Titouan de Bailleul
Titouan de Bailleul

Reputation: 12949

You probably need to set a layout to your Ext.Panel.

Try :

var nestedListxx = Ext.create("Ext.Panel", {
    width:260,
    layout:'fit',
    items:nestedList
});

Hope this helps

Upvotes: 1

Related Questions