Skip to content

Commit 3a66bd3

Browse files
committed
fix: disable group title editor
1 parent 7c7e9c2 commit 3a66bd3

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@visactor/vtable",
5+
"comment": "fix: disable group title editor",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@visactor/vtable"
10+
}

packages/vtable/examples/editor/date-editor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export function createTable() {
184184
},
185185
editor(args) {
186186
return new InputEditor({});
187-
}
187+
},
188+
groupBy: ['sex']
188189
};
189190
const tableInstance = new VTable.ListTable(option);
190191
tableInstance.on('initialized', args => {

packages/vtable/src/edit/edit-manager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ export class EditManager {
9090
return;
9191
}
9292

93+
// group title cell do not allow edit
94+
const record = this.table.getCellRawRecord(col, row);
95+
if (record.vtableMerge) {
96+
console.warn("VTable Warn: this is group title, can't be edited");
97+
return;
98+
}
99+
93100
if (!this.editingEditor) {
94101
this.editCell = { col, row };
95102
}

0 commit comments

Comments
 (0)