我有下面的代碼爲煎茶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'
]
});