mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 16:43:59 +00:00
set row data in data sheet
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user