# GridEditorInstance

Fields, allowed values, and APIs that use GridEditorInstance.

Canonical: https://grid.syidax.com/docs/types/GridEditorInstance/

<a id="definition"></a>

## Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

```typescript
export interface GridEditorInstance<
  TData = Record<string, unknown>,
  TValue = unknown,
  TContext = unknown,
> extends GridGuiComponent<
    GridEditorParams<TData, TValue, TContext>,
    HTMLElement
  > {
  afterGuiAttached?(): GridMaybePromise<void>;
  getValue(): GridMaybePromise<TValue>;
  isCancelBeforeStart?(): GridMaybePromise<boolean>;
  isCancelAfterEnd?(): GridMaybePromise<boolean>;
  isPopup?(): boolean;
  getPopupPosition?(): 'over' | 'under';
  getValidationErrors?(
    value: TValue,
  ): GridMaybePromise<ReadonlyArray<GridEditorValidationError> | null>;
  focusIn?(): void;
  focusOut?(): void;
}
```

<a id="used-by"></a>

## APIs using this type

- [getCellEditorInstance](https://grid.syidax.com/docs/methods/getCellEditorInstance.md) — Reads the mounted cell editor instance and context, or null if no editor exists.

<a id="parents"></a>

## Contracts containing this type

- [GridEditorDefinition](https://grid.syidax.com/docs/types/GridEditorDefinition.md)
- [SyGridImperativeMethods](https://grid.syidax.com/docs/types/SyGridImperativeMethods.md)

<a id="related"></a>

## Related types

- [GridGuiComponent](https://grid.syidax.com/docs/types/GridGuiComponent.md)
- [GridEditorParams](https://grid.syidax.com/docs/types/GridEditorParams.md)
- [GridMaybePromise](https://grid.syidax.com/docs/types/GridMaybePromise.md)
- [GridEditorValidationError](https://grid.syidax.com/docs/types/GridEditorValidationError.md)
