Sencha Touch - NestedList 仅在旋转后显示

发布于 2024-11-26 17:19:25 字数 1968 浏览 2 评论 0原文

我一直在玩 sencha touch 一点,但遇到了问题。 我有一个选项卡式 UI,其中一个选项卡具有由以下代码定义的 xtype 'pastcard':

    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: 'memory',
        reader: {
            type: 'tree',
            root: 'items'
        }
    }
});
var nestedList = new Ext.NestedList({
    fullscreen: true,
    title: 'Groceries',
    displayField: 'text',
    dock: 'top',
    store: store
});
    metanamorph.views.Pastcard = Ext.extend(Ext.Panel, {
    title: "past",
    iconCls: "add",
    dockedItems: nestedList
});

Ext.reg('pastcard', metanamorph.views.Pastcard);

在我的桌面浏览器中,这工作正常,但在我的 iPhone 和 iPhone 模拟器上,'过去' 站点包含列表 'Groceries' 但不' t 显示任何列表项。但是,如果我旋转设备,列表就会显示。这可能是因为旋转时有某种刷新。

如何解决这个问题?

I've been playing around with sencha touch a little and I've encountered a problem.
I have a tabbed UI and one tab has the xtype 'pastcard' defined by the following code:

    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: 'memory',
        reader: {
            type: 'tree',
            root: 'items'
        }
    }
});
var nestedList = new Ext.NestedList({
    fullscreen: true,
    title: 'Groceries',
    displayField: 'text',
    dock: 'top',
    store: store
});
    metanamorph.views.Pastcard = Ext.extend(Ext.Panel, {
    title: "past",
    iconCls: "add",
    dockedItems: nestedList
});

Ext.reg('pastcard', metanamorph.views.Pastcard);

In my Desktop Browser this works fine, but on my iPhone and the iPhone Simulator the 'past' site contains the List 'Groceries' but doesn't show any list items. However if I rotate the Device the List shows. This is probably because there is some sort of refresh on rotate.

How to fix this?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文