Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit f9f9287

Browse files
authored
Merge pull request #1516 from ghiscoding/bugfix/composite-styling-onsort
chore(demo): Composite Editor unsaved styling should follow Sort changes
2 parents a5076f3 + 9e3907d commit f9f9287

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/app/examples/grid-composite-editor.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ <h2>
109109
(onCompositeEditorChange)="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)"
110110
(onItemDeleted)="handleItemDeleted($event.detail)"
111111
(onGridStateChanged)="handleOnGridStateChanged($event.detail)"
112-
(onPaginationChanged)="handleReRenderUnsavedStyling()"
113-
(onFilterChanged)="handleReRenderUnsavedStyling()"
112+
(onRowsOrCountChanged)="handleReRenderUnsavedStyling()"
114113
(onValidationError)="handleValidationError($event.detail.eventData, $event.detail.args)"
115114
>
116115
</angular-slickgrid>

src/app/examples/grid-composite-editor.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit {
782782
removeUnsavedStylingFromCell(_item: any, column: Column, row: number) {
783783
// remove unsaved css class from that cell
784784
const cssStyleKey = `unsaved_highlight_${[column.id]}${row}`;
785-
this.angularGrid.slickGrid.removeCellCssStyles(cssStyleKey);
785+
this.angularGrid.slickGrid?.removeCellCssStyles(cssStyleKey);
786786
const foundIdx = this.cellCssStyleQueue.findIndex((styleKey) => styleKey === cssStyleKey);
787787
if (foundIdx >= 0) {
788788
this.cellCssStyleQueue.splice(foundIdx, 1);
@@ -791,7 +791,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit {
791791

792792
removeAllUnsavedStylingFromCell() {
793793
for (const cssStyleKey of this.cellCssStyleQueue) {
794-
this.angularGrid.slickGrid.removeCellCssStyles(cssStyleKey);
794+
this.angularGrid.slickGrid?.removeCellCssStyles(cssStyleKey);
795795
}
796796
this.cellCssStyleQueue = [];
797797
}
@@ -815,7 +815,7 @@ export class GridCompositeEditorComponent implements OnDestroy, OnInit {
815815
if (row !== undefined && row >= 0) {
816816
const hash = { [row]: { [column.id]: 'unsaved-editable-field' } };
817817
const cssStyleKey = `unsaved_highlight_${[column.id]}${row}`;
818-
this.angularGrid.slickGrid.setCellCssStyles(cssStyleKey, hash);
818+
this.angularGrid.slickGrid?.setCellCssStyles(cssStyleKey, hash);
819819
this.cellCssStyleQueue.push(cssStyleKey);
820820
}
821821
}

0 commit comments

Comments
 (0)