0
我想知道是否可以在嵌套列表的第一級上顯示子葉子?Sencha Touch:嵌套列表與一個級別?
在旁邊的例子中,當我選擇「我的類別」(最後一項)時,我想顯示一個頁面,但如果我使用getDetailCard函數,我有一個父問題。該消息是:
「 '未定義' 不是(評價 'parent.attributes.record.data')的對象」
DATA
var data = {
text: 'Groceries',
items: [{
text: 'WATER',
items: [{
text: 'Water',
items: [{
text: 'Sparkling',
info : 'THIS TEXT IS SHOWN IN THE CHILD LEAF',
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: 'My Category',
info : 'TEXT I WANT TO SHOW ON A CHILD LEAF',
leaf: true
}]
};
MODEL & STORE:
Ext.regModel('ListItem', {
fields: [
{name: 'text', type: 'string'},
{name: 'info', type: 'string'}
]
});
var store = new Ext.data.TreeStore({
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});
感謝您的幫助,問候。