【发布时间】:2014-02-28 00:49:58
【问题描述】:
双击网格中的一行时出现问题,出现错误:
Uncaught TypeError: Cannot read property 'internalId' of undefined
这是我的活动代码:
itemdblclick : function (view, record, item, index, eventOptions) {
console.log(record);
me.unassignedGrid.getStore().add(record);
removedDevices.push(record);
me.assignedGrid.getStore().remove(record);
}
当我调试代码时,错误指向:粗体行:i = 4,但记录仅包含 4 个元素。是不是很奇怪? (下面的代码来自 ext-all-debug.js v 4.1.3)
updateIndexes : function(startIndex, endIndex) {
var ns = this.all.elements,
records = this.store.getRange(),
i;
startIndex = startIndex || 0;
endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));
for(i = startIndex; i <= endIndex; i++){
ns[i].viewIndex = i;
**ns[i].viewRecordId = records[i].internalId;**
if (!ns[i].boundView) {
ns[i].boundView = this.id;
}
}
},
【问题讨论】:
标签: javascript extjs4.1