Sencha Touch - NestedList 仅在旋转后显示
我一直在玩 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论