feat(grid): add set NULL context menu action

This commit is contained in:
LRcoding authored and GitHub committed 2026-07-15 15:25:25 +08:00
1 parent 10827f105a
commit 669f3a4914
4 files changed
+153 -1

No files matched your search

+15 -1
View File
@@ -7046,6 +7046,11 @@ function selectionHasEditableCells(): boolean {
return false;
}
function setSelectionNull() {
if (!props.editable || !selectionHasEditableCells()) return;
fillSelectionWithValue(null);
}
function openBulkEditDialog() {
if (!props.editable || !selectionHasEditableCells()) return;
bulkEditValue.value = "";
@@ -8989,10 +8994,19 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
}
if (props.editable && hasCellSelection.value) {
const hasEditableSelection = selectionHasEditableCells();
if (!contextHeaderColumn.value) {
items.push({
label: t("grid.setNull"),
action: setSelectionNull,
disabled: !hasEditableSelection,
icon: X,
});
}
items.push({
label: t("grid.bulkEditSelection"),
action: openBulkEditDialog,
disabled: !selectionHasEditableCells(),
disabled: !hasEditableSelection,
icon: Pencil,
});
}