From 9e3907d2e50feafbc201f94cf037b72ef8773413 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Mon, 20 Jan 2025 20:38:04 -0500 Subject: [PATCH] chore(demo): Composite Editor unsaved styling should follow Sort changes --- src/app/examples/grid-composite-editor.component.html | 3 +-- src/app/examples/grid-composite-editor.component.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/examples/grid-composite-editor.component.html b/src/app/examples/grid-composite-editor.component.html index 362be4554..1212fc7a1 100644 --- a/src/app/examples/grid-composite-editor.component.html +++ b/src/app/examples/grid-composite-editor.component.html @@ -109,8 +109,7 @@

(onCompositeEditorChange)="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)" (onItemDeleted)="handleItemDeleted($event.detail)" (onGridStateChanged)="handleOnGridStateChanged($event.detail)" - (onPaginationChanged)="handleReRenderUnsavedStyling()" - (onFilterChanged)="handleReRenderUnsavedStyling()" + (onRowsOrCountChanged)="handleReRenderUnsavedStyling()" (onValidationError)="handleValidationError($event.detail.eventData, $event.detail.args)" > diff --git a/src/app/examples/grid-composite-editor.component.ts b/src/app/examples/grid-composite-editor.component.ts index ffa98cced..317753df1 100644 --- a/src/app/examples/grid-composite-editor.component.ts +++ b/src/app/examples/grid-composite-editor.component.ts @@ -782,7 +782,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit { removeUnsavedStylingFromCell(_item: any, column: Column, row: number) { // remove unsaved css class from that cell const cssStyleKey = `unsaved_highlight_${[column.id]}${row}`; - this.angularGrid.slickGrid.removeCellCssStyles(cssStyleKey); + this.angularGrid.slickGrid?.removeCellCssStyles(cssStyleKey); const foundIdx = this.cellCssStyleQueue.findIndex((styleKey) => styleKey === cssStyleKey); if (foundIdx >= 0) { this.cellCssStyleQueue.splice(foundIdx, 1); @@ -791,7 +791,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit { removeAllUnsavedStylingFromCell() { for (const cssStyleKey of this.cellCssStyleQueue) { - this.angularGrid.slickGrid.removeCellCssStyles(cssStyleKey); + this.angularGrid.slickGrid?.removeCellCssStyles(cssStyleKey); } this.cellCssStyleQueue = []; } @@ -815,7 +815,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit { if (row !== undefined && row >= 0) { const hash = { [row]: { [column.id]: 'unsaved-editable-field' } }; const cssStyleKey = `unsaved_highlight_${[column.id]}${row}`; - this.angularGrid.slickGrid.setCellCssStyles(cssStyleKey, hash); + this.angularGrid.slickGrid?.setCellCssStyles(cssStyleKey, hash); this.cellCssStyleQueue.push(cssStyleKey); } }