From f73cf5983a919f977d8b29d0b606e2fb433f5863 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 27 Sep 2024 11:14:32 +0200 Subject: [PATCH] Hide column --- .../src/components/grid/cells/HeaderCell.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte index 00b2cbabf3..f516ba7d29 100644 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte @@ -165,7 +165,17 @@ } const hideColumn = () => { - datasource.actions.addSchemaMutation(column.name, { visible: false }) + const { related } = column + const mutation = { visible: false } + if (!related) { + datasource.actions.addSchemaMutation(column.name, mutation) + } else { + datasource.actions.addSubSchemaMutation( + related.subField, + related.field, + mutation + ) + } datasource.actions.saveSchemaMutations() open = false }