diff --git a/src/app/modules/angular-slickgrid/models/editCommand.interface.ts b/src/app/modules/angular-slickgrid/models/editCommand.interface.ts new file mode 100644 index 000000000..f70144c09 --- /dev/null +++ b/src/app/modules/angular-slickgrid/models/editCommand.interface.ts @@ -0,0 +1,15 @@ +import { Editor } from "."; + +export interface EditCommand { + row: number; + cell: number; + editor: Editor | any; + serializedValue: any; + prevSerializedValue: any; + + /** Call to commit changes*/ + execute: () => void; + + /** Call to rollback changes*/ + undo: () => void; +} \ No newline at end of file diff --git a/src/app/modules/angular-slickgrid/models/gridOption.interface.ts b/src/app/modules/angular-slickgrid/models/gridOption.interface.ts index 7348aeb4e..c293d2f5f 100644 --- a/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +++ b/src/app/modules/angular-slickgrid/models/gridOption.interface.ts @@ -8,6 +8,8 @@ import { GridMenu } from './gridMenu.interface'; import { HeaderButton } from './headerButton.interface'; import { HeaderMenu } from './headerMenu.interface'; import { Pagination } from './pagination.interface'; +import { Column } from './column.interface'; +import { EditCommand } from './editCommand.interface'; export interface GridOption { /** Defaults to false, which leads to load editor asynchronously (delayed) */ @@ -49,6 +51,9 @@ export interface GridOption { /** Defaults to false, when enabled will give the possibility to edit cell values with inline editors. */ editable?: boolean; + /** option to intercept edit commands and implement undo support.*/ + editCommandHandler?: (item: any, column: Column, command: EditCommand) => void; + /** Do we want to enable asynchronous (delayed) post rendering */ enableAsyncPostRender?: boolean;