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

extend GridOption with editCommandHandler option #15

Merged
merged 2 commits into from
Feb 26, 2018
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
15 changes: 15 additions & 0 deletions src/app/modules/angular-slickgrid/models/editCommand.interface.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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;

Expand Down