Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
OperatorType,
SortComparers,
SlickGlobalEditorLock,
type SlickGrid,
type SliderOption,
type VanillaCalendarOption,
} from '../../library';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/core/__tests__/slickGrid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/core/slickGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6195,7 +6195,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down