diff --git a/frameworks/angular-slickgrid/src/demos/examples/example03.component.ts b/frameworks/angular-slickgrid/src/demos/examples/example03.component.ts index 496cf3437e..d830989504 100644 --- a/frameworks/angular-slickgrid/src/demos/examples/example03.component.ts +++ b/frameworks/angular-slickgrid/src/demos/examples/example03.component.ts @@ -18,6 +18,7 @@ import { OperatorType, SortComparers, SlickGlobalEditorLock, + type SlickGrid, type SliderOption, type VanillaCalendarOption, } from '../../library'; @@ -70,7 +71,7 @@ export class Example3Component implements OnInit { columnDefinitions!: Column[]; gridOptions!: GridOption; dataset!: any[]; - gridObj: any; + gridObj: SlickGrid | undefined; hideSubTitle = false; isAutoEdit = true; alertWarning: any; @@ -630,7 +631,7 @@ export class Example3Component implements OnInit { changeAutoCommit() { this.gridOptions.autoCommitEdit = !this.gridOptions.autoCommitEdit; - this.gridObj.setOptions({ + this.gridObj?.setOptions({ autoCommitEdit: this.gridOptions.autoCommitEdit, }); return true; @@ -680,7 +681,7 @@ export class Example3Component implements OnInit { setAutoEdit(isAutoEdit: boolean) { this.isAutoEdit = isAutoEdit; - this.gridObj.setOptions({ autoEdit: isAutoEdit }); // change the grid option dynamically + this.gridObj?.setOptions({ autoEdit: isAutoEdit }); // change the grid option dynamically return true; } @@ -689,7 +690,7 @@ export class Example3Component implements OnInit { // const item = this.angularGrid.dataView.getItem(command.row); if (command && SlickGlobalEditorLock.cancelCurrentEdit()) { command.undo(); - this.gridObj.gotoCell(command.row, command.cell, false); + this.gridObj?.gotoCell(command.row, command.cell, false); } } diff --git a/packages/common/src/core/__tests__/slickGrid.spec.ts b/packages/common/src/core/__tests__/slickGrid.spec.ts index 7c49c90cd0..262b6c9656 100644 --- a/packages/common/src/core/__tests__/slickGrid.spec.ts +++ b/packages/common/src/core/__tests__/slickGrid.spec.ts @@ -359,7 +359,7 @@ describe('SlickGrid core file', () => { }); grid.setData(data); grid.setActiveCell(0, 0); - grid.editActiveCell(InputEditor as any, true); + grid.editActiveCell(undefined, true); expect(grid.getCellEditor()).toBeTruthy(); const onBeforeSpy = vi.spyOn(grid.onBeforeCellEditorDestroy, 'notify'); diff --git a/packages/common/src/core/slickGrid.ts b/packages/common/src/core/slickGrid.ts index 59f87d9b1d..326df5a77f 100755 --- a/packages/common/src/core/slickGrid.ts +++ b/packages/common/src/core/slickGrid.ts @@ -6195,7 +6195,7 @@ export class SlickGrid = Column, O e } } - editActiveCell(editor: Editor | EditorConstructor, preClickModeOn?: boolean | null, e?: Event): void { + editActiveCell(editor?: Editor | EditorConstructor, preClickModeOn?: boolean | null, e?: Event): void { this.makeActiveCellEditable(editor, preClickModeOn, e); } diff --git a/packages/composite-editor-component/src/slick-composite-editor.component.ts b/packages/composite-editor-component/src/slick-composite-editor.component.ts index 8567892b2b..0a9d97066a 100644 --- a/packages/composite-editor-component/src/slick-composite-editor.component.ts +++ b/packages/composite-editor-component/src/slick-composite-editor.component.ts @@ -564,7 +564,7 @@ export class SlickCompositeEditorComponent implements ExternalResource { this._editorContainers, this._compositeOptions ) as typeof SlickCompositeEditor; - this.grid.editActiveCell(compositeEditor as any); + this.grid.editActiveCell(compositeEditor as unknown as Editor); // -- // Add a few Event Handlers