我的 Sencha Touch 嵌套列表仅在全屏时不显示数据:true?

发布于 2024-12-05 10:13:28 字数 2023 浏览 3 评论 0原文

为什么我的嵌套列表不显示数据,它仅在 fullscreen:true 中显示,

new Ext.Application({
    launch: function() {
        new Ext.Panel({
            fullscreen: true,
            items: [],
            dockedItems: [
                {
                    xtype:'panel',
                    dock: 'left',
                    width:300,
                    items:[nestedList],
                    style: 'border-right:1px solid #042040;'
                },
                {
                    xtype: 'toolbar',
                    title: 'Sencha Touch ',
                    dock: 'top'

                }

            ]

        });
    }
});



var data = {
     text: 'Groceries',
    items: [{
        text: 'Drinks',
        items: [{
             text: 'Water',
            items: [{
                text: 'Sparkling',
                leaf: true
        },{
            text: 'Still',
            leaf: true
        }]
    },{
        text: 'Coffee',
        leaf: true
    },{
        text: 'Espresso',
        leaf: true
    },{
        text: 'Redbull',
        leaf: true
    },{
        text: 'Coke',
        leaf: true
    },{
        text: 'Diet Coke',
        leaf: true
    }]
},{
    text: 'Fruit',
    items: [{
        text: 'Bananas',
        leaf: true
    },{
        text: 'Lemon',
        leaf: true
    }]
},{
    text: 'Snacks',
    items: [{
        text: 'Nuts',
        leaf: true
    },{
        text: 'Pretzels',
        leaf: true
    },{
        text: 'Wasabi Peas',
        leaf: true
    }]
},{
    text: 'Empty Category',
    items: []
}]
};

Ext.regModel('ListItem', {
     fields: [{name: 'text', type: 'string'}]
});

var store = new Ext.data.TreeStore({
    model: 'ListItem',
    root: data,
    proxy: {
        type: 'ajax',
        reader: {
            type: 'tree',
            root: 'items'
    }
}
});

var nestedList = new Ext.NestedList({
    title: 'Groceries',
    displayField: 'text',
    //fullscreen:true, // only with this turned on?
    store: store
});

why is my nested list not showing data, it only shows when in fullscreen:true ,

new Ext.Application({
    launch: function() {
        new Ext.Panel({
            fullscreen: true,
            items: [],
            dockedItems: [
                {
                    xtype:'panel',
                    dock: 'left',
                    width:300,
                    items:[nestedList],
                    style: 'border-right:1px solid #042040;'
                },
                {
                    xtype: 'toolbar',
                    title: 'Sencha Touch ',
                    dock: 'top'

                }

            ]

        });
    }
});



var data = {
     text: 'Groceries',
    items: [{
        text: 'Drinks',
        items: [{
             text: 'Water',
            items: [{
                text: 'Sparkling',
                leaf: true
        },{
            text: 'Still',
            leaf: true
        }]
    },{
        text: 'Coffee',
        leaf: true
    },{
        text: 'Espresso',
        leaf: true
    },{
        text: 'Redbull',
        leaf: true
    },{
        text: 'Coke',
        leaf: true
    },{
        text: 'Diet Coke',
        leaf: true
    }]
},{
    text: 'Fruit',
    items: [{
        text: 'Bananas',
        leaf: true
    },{
        text: 'Lemon',
        leaf: true
    }]
},{
    text: 'Snacks',
    items: [{
        text: 'Nuts',
        leaf: true
    },{
        text: 'Pretzels',
        leaf: true
    },{
        text: 'Wasabi Peas',
        leaf: true
    }]
},{
    text: 'Empty Category',
    items: []
}]
};

Ext.regModel('ListItem', {
     fields: [{name: 'text', type: 'string'}]
});

var store = new Ext.data.TreeStore({
    model: 'ListItem',
    root: data,
    proxy: {
        type: 'ajax',
        reader: {
            type: 'tree',
            root: 'items'
    }
}
});

var nestedList = new Ext.NestedList({
    title: 'Groceries',
    displayField: 'text',
    //fullscreen:true, // only with this turned on?
    store: store
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

菩提树下叶撕阳。 2024-12-12 10:13:28

它需要知道如何布局列表。尝试设置 layout: 'auto' 。但这样您将无法使用cardSwitchAnimation,因此列表不会嵌套,即如果您点击列表项,则不会发生任何事情。

无论如何,你想做什么?

It needs that to know how to layout the list. Try setting layout: 'auto' instead. But that way you won't be able to use the cardSwitchAnimation so the list won't be nested, i.e. nothing will happen if you tap on a list item.

Anyway what are you trying to do?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文