【发布时间】:2012-02-29 01:35:19
【问题描述】:
我有下面的 Sencha Touch2 代码,当我运行它时,我得到了类似的错误
未捕获的类型错误:无法读取未定义的属性“属性”
我见过很多类似的代码,就像我为 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'
]
});
【问题讨论】: