1 | // Type definitions for ag-grid v18.1.2
|
2 | // Project: http://www.ag-grid.com/
|
3 | // Definitions by: Niall Crosby <https://github.com/ag-grid/>
|
4 | import { Column } from "../../entities/column";
|
5 | import { RowNode } from "../../entities/rowNode";
|
6 | import { GridApi } from "../../gridApi";
|
7 | import { ColumnApi } from "../../columnController/columnApi";
|
8 | import { IComponent } from "../../interfaces/iComponent";
|
9 | export interface ICellEditor {
|
10 | /** Return the final value - called by the grid once after editing is complete */
|
11 | getValue(): any;
|
12 | /** Gets called once after initialised. If you return true, the editor will appear in a popup, so is not constrained
|
13 | * to the boundaries of the cell. This is great if you want to, for example, provide you own custom dropdown list
|
14 | * for selection. Default is false (ie if you don't provide the method). */
|
15 | isPopup?(): boolean;
|
16 | /** Gets called once after initialised. If you return true, the editor will not be used and the grid will continue
|
17 | * editing. Use this to make a decision on editing inside the init() function, eg maybe you want to only start
|
18 | * editing if the user hits a numeric key, but not a letter, if the editor is for numbers.
|
19 | * */
|
20 | isCancelBeforeStart?(): boolean;
|
21 | /** Gets called once after editing is complete. If your return true, then the new value will not be used. The
|
22 | * editing will have no impact on the record. Use this if you do not want a new value from your gui, i.e. you
|
23 | * want to cancel the editing. */
|
24 | isCancelAfterEnd?(): boolean;
|
25 | /** If doing full line edit, then gets called when focus should be put into the editor */
|
26 | focusIn?(): void;
|
27 | /** If doing full line edit, then gets called when focus is leaving the editor */
|
28 | focusOut?(): void;
|
29 | }
|
30 | export interface ICellEditorComp extends ICellEditor, IComponent<ICellEditorParams> {
|
31 | }
|
32 | export interface ICellEditorParams {
|
33 | value: any;
|
34 | keyPress: number;
|
35 | charPress: string;
|
36 | column: Column;
|
37 | node: RowNode;
|
38 | rowIndex: number;
|
39 | api: GridApi;
|
40 | columnApi: ColumnApi;
|
41 | cellStartedEdit: boolean;
|
42 | context: any;
|
43 | $scope: any;
|
44 | onKeyDown: (event: KeyboardEvent) => void;
|
45 | stopEditing: (suppressNavigateAfterEdit?: boolean) => void;
|
46 | eGridCell: HTMLElement;
|
47 | parseValue: (value: any) => any;
|
48 | formatValue: (value: any) => any;
|
49 | }
|