我使用Dojo,使用网格,当我双击单元格或列时,我收到错误TypeError: this._click[0] is undefined
。所以我查看代码并看到:
onCellDblClick: function(e){
// summary:
// Event fired when a cell is double-clicked.
// e: Event
// Decorated event object contains reference to grid, cell, and rowIndex
console.log(this);
if(dojo.isIE){
this.edit.setEditCell(this._click[1].cell, this._click[1].rowIndex);
}else if(this._click[0].rowIndex != this._click[1].rowIndex){
this.edit.setEditCell(this._click[0].cell, this._click[0].rowIndex);
}else{
this.edit.setEditCell(e.cell, e.rowIndex);
}
this.onRowDblClick(e);
},
问题是 _click 是空数组。我对dojo没有任何经验,也不知道何时获取该数据。
答案 0 :(得分:0)
你可以这样做:
on(GridNode, 'CellDblClick', lang.hitch(this, function () { ... });