My Sencha Touch nested-list not shownig data, only when in fullscreen:true?
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: 'Re开发者_开发百科dbull',
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
});
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?
精彩评论