From 869e837ee56caa6c93a3b8099c018c37a720b653 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 22 Aug 2024 08:16:31 +0200 Subject: [PATCH] fix --- packages/datalib/src/CollectionGridDisplay.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datalib/src/CollectionGridDisplay.ts b/packages/datalib/src/CollectionGridDisplay.ts index 572341c8..f53fe7d9 100644 --- a/packages/datalib/src/CollectionGridDisplay.ts +++ b/packages/datalib/src/CollectionGridDisplay.ts @@ -105,10 +105,10 @@ export class CollectionGridDisplay extends GridDisplay { this.columns = analyseCollectionDisplayColumns([...(loadedRows || []), ...changedDocs, ...insertedDocs], this); this.filterable = true; this.sortable = true; - this.editable = !readOnly; + this.editable = !readOnly && collection?.uniqueKey?.length > 0; this.supportsReload = true; this.isDynamicStructure = true; - this.changeSetKeyFields = ['_id']; + this.changeSetKeyFields = collection?.uniqueKey?.map(x => x.columnName); this.baseCollection = collection; } }