0
我使用这个模型:煎茶nestedList getActiveItem()
Ext.regModel('ListItem', {
fields: [
{name: 'id', type: 'string'},
{name: 'text', type: 'string'},
{name: 'number', type: 'string'}
]
});
nestedList是:
var nestedList = new Ext.NestedList({
fullscreen: true,
title: ivrData.text,
store: NestedListDemo.music_store,
getDetailCard: function(item, parent) {
alert(item.attributes.record.data.number);
}
});
我试图让财产activeItem的。数上按钮点击。
handler : function(btn, evt) {
var temp = nestedList.getActiveItem();
alert(temp.number);
alert(temp.attributes.record.data.number);
}
我能够通过alert(item.attributes.record.data.number);
得到叶节点上的。数财产,但我得到这些错误,而试图得到。数属性温度:
alert(temp.number);
版画 - >未定义
alert(temp.attributes.record.data.number);
给出错误 - > “类型错误:表达的结果 'temp.attributes'[未定义]不是对象”
顺便提一下,alert(temp)给出了[object Object] – 2011-12-27 11:10:13