set row data in data sheet

This commit is contained in:
Jan Prochazka
2021-12-09 15:51:41 +01:00
parent 140b01946c
commit 2679062b95

View File

@@ -24,12 +24,22 @@ export default class FreeTableGrider extends Grider {
} }
setCellValue(index: number, uniqueName: string, value: any) { setCellValue(index: number, uniqueName: string, value: any) {
const model = this.currentModel; const model = this.currentModel;
if (model.rows[index]) if (model.rows[index]) {
this.currentModel = { this.currentModel = {
...model, ...model,
rows: model.rows.map((row, i) => (index == i ? { ...row, [uniqueName]: value } : row)), rows: model.rows.map((row, i) => (index == i ? { ...row, [uniqueName]: value } : row)),
}; };
} }
}
setRowData(index: number, document: any) {
const model = this.currentModel;
if (model.rows[index]) {
this.currentModel = {
...model,
rows: model.rows.map((row, i) => (index == i ? document : row)),
};
}
}
get editable() { get editable() {
return true; return true;
} }