【问题标题】:Nestedlist not showing store data when inside panel嵌套列表在面板内时不显示商店数据
【发布时间】:2012-06-05 08:43:20
【问题描述】:

当此列表显示在面板内时,我在加载我的嵌套列表数据时遇到问题。 这是我的代码:

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

问题如下: 说如果我改变 nestedListxx.showBy(this);nestedList.showBy(this); 它就像一个魅力,只是嵌套列表周围没有光滑的黑色边框。 但是如果我把它改回来,它确实会显示带有漂亮边框但没有任何数据的嵌套列表。

我确定我忘了设置一些关键配置,唯一的问题是:哪些

【问题讨论】:

    标签: panel sencha-touch-2 nested-lists


    【解决方案1】:

    您可能需要为您的Ext.Panel 设置一个布局。

    试试:

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

    希望对你有帮助

    【讨论】:

    • 非常感谢,我知道这是我的配置错误。还有一个问题,我应该设置什么配置以使列表不呈现到页面的末尾,但只要它本身?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-07
    • 2014-09-06
    • 2019-11-19
    • 1970-01-01
    • 2011-12-02
    • 2021-04-07
    相关资源
    最近更新 更多