我的 Sencha Touch 嵌套列表仅在全屏时不显示数据:true?
为什么我的嵌套列表不显示数据,它仅在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它需要知道如何布局列表。尝试设置
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?