【发布时间】:2019-12-25 11:24:00
【问题描述】:
当我使用 afterChange 钩子(Angular 6 + Handsontable)并在其中使用 hot.getDataAtCell(...) 时,行中的所有单元格都会更改
我尝试使用不同的钩子(beforeChange、afterChange),但都不起作用
if (changes && source) {
this.newCellCol = source[0][0];
this.newCellRow = source[0][1] + 1;
this.newCellData = this.tempId.getDataAtCell(source[0][0], source[0][1]);
console.log(this.newCellData);
}
},
afterChange: (changes, source) => {
if (changes && source) {
this.tempId.setDataAtCell(this.newCellCol, this.newCellRow, this.newCellData);
}
}
};
我希望在它旁边的单元格中也输入附加值 但它会被添加到同一行的所有单元格中 最终的解决方案是根据一个单元格中输入的数据,将不同的计算数据插入到同一行的3个不同的单元格中
【问题讨论】:
标签: angular6 cell handsontable