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

Commit da67007

Browse files
asdman384ghiscoding
authored andcommitted
extend GridOption with editCommandHandler option (#15)
* extend GridOption with editCommandHandler option; add EditCommand interface
1 parent d220db8 commit da67007

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Editor } from ".";
2+
3+
export interface EditCommand {
4+
row: number;
5+
cell: number;
6+
editor: Editor | any;
7+
serializedValue: any;
8+
prevSerializedValue: any;
9+
10+
/** Call to commit changes*/
11+
execute: () => void;
12+
13+
/** Call to rollback changes*/
14+
undo: () => void;
15+
}

src/app/modules/angular-slickgrid/models/gridOption.interface.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { GridMenu } from './gridMenu.interface';
88
import { HeaderButton } from './headerButton.interface';
99
import { HeaderMenu } from './headerMenu.interface';
1010
import { Pagination } from './pagination.interface';
11+
import { Column } from './column.interface';
12+
import { EditCommand } from './editCommand.interface';
1113

1214
export interface GridOption {
1315
/** Defaults to false, which leads to load editor asynchronously (delayed) */
@@ -49,6 +51,9 @@ export interface GridOption {
4951
/** Defaults to false, when enabled will give the possibility to edit cell values with inline editors. */
5052
editable?: boolean;
5153

54+
/** option to intercept edit commands and implement undo support.*/
55+
editCommandHandler?: (item: any, column: Column, command: EditCommand) => void;
56+
5257
/** Do we want to enable asynchronous (delayed) post rendering */
5358
enableAsyncPostRender?: boolean;
5459

0 commit comments

Comments
 (0)