我有下面的代码为煎茶Touch2,当我运行它,我得到了错误,如煎茶触摸Nestedlist不能运行getDetailCard
Uncaught TypeError: Cannot read property 'attributes' of undefined
我见过很多类似的代码,我把对getDetailCard。为什么我的人无法获得“属性”属性?
Ext.define('MyApp.view.MainTabPanel', {
extend: 'Ext.tab.Panel',
config: {
tabBar: {
docked: 'top'
},
items: [
{
xtype: 'container',
title: 'Documents'
},
{
xtype: 'nestedlist',
itemId: 'newslist',
ui: 'dark',
displayField: 'title',
store: 'NewsStoreXML',
title: 'News',
getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data,
parentData = parent.attributes.record.data,
detailCard = new Ext.Panel({
scroll: 'vertical',
styleHtmlContent: true,
tpl: ["<h2>{text}</h2>","{content}"]
});
detailCard.update(itemData);
this.backButton.setText(parentData.text);
return detailCard;
}
},
{
xtype: 'container',
title: 'Calendar'
}
]
},
requires: [
'Ext.dataview.NestedList',
'Ext.TitleBar'
]
});