From ca9340ddbbf5dcb9cfdbe2744a54b02cd31e8d31 Mon Sep 17 00:00:00 2001 From: "Ghislain B." Date: Sat, 14 Dec 2024 16:03:17 -0500 Subject: [PATCH] fix: add missing collection observer to watch changes (#443) --- src/examples/slickgrid/Example3.tsx | 1 - .../components/slickgrid-react.tsx | 24 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/examples/slickgrid/Example3.tsx b/src/examples/slickgrid/Example3.tsx index 5fea67f..1b0caa9 100644 --- a/src/examples/slickgrid/Example3.tsx +++ b/src/examples/slickgrid/Example3.tsx @@ -634,7 +634,6 @@ export default function Example3() { /* // remove your column the full set of columns - // and use slice or spread [...] to trigger an React dirty change allOriginalColumns.pop(); columnDefinitions = allOriginalColumns.slice(); */ diff --git a/src/slickgrid-react/components/slickgrid-react.tsx b/src/slickgrid-react/components/slickgrid-react.tsx index 30c3c35..ff75de1 100644 --- a/src/slickgrid-react/components/slickgrid-react.tsx +++ b/src/slickgrid-react/components/slickgrid-react.tsx @@ -22,6 +22,7 @@ import { // services BackendUtilityService, + collectionObserver, CollectionService, EventNamingStyle, ExtensionService, @@ -97,6 +98,7 @@ export class SlickgridReact extends React.Component void; })> = []; protected _eventHandler!: SlickEventHandler; protected _eventPubSubService!: EventPubSubService; protected _hideHeaderRowAfterPageLoad = false; @@ -602,6 +604,9 @@ export class SlickgridReact extends React.Component extends React.Component obs?.disconnect()); this._eventPubSubService.publish(`onAfterGridDestroyed`, true); // dispose of all Services @@ -696,7 +702,7 @@ export class SlickgridReact extends React.Component extends React.Component extends React.Component