# Editor Dropdown
URL: https://pro.rv-grid.com/api/editor-dropdown/
Source: src/content/docs/api/editor-dropdown.md
## Module Extensions

### `ColumnRegular` (Extended from `@revolist/revogrid`)

```ts
interface ColumnRegular {
  /**
       * Configuration for dropdown editor
       */
      dropdown?: DropdownProps;
  /**
       * Column-select compatible dropdown source.
       */
      source?: DropdownColumnSourceEntry[];
  /**
       * Object source label field used by dropdown columns.
       */
      labelKey?: string;
  /**
       * Object source value field used by dropdown columns.
       */
      valueKey?: string
}
```

## Plugin API

### `DropdownColumnSourceEntry`

```ts
export type DropdownColumnSourceEntry = string | Record<string, unknown>;
```

---

### `normalizeDropdownOptions`

```ts
normalizeDropdownOptions: (source?: unknown[], labelKey?: string | undefined, valueKey?: string | undefined) => DropdownOption[];
```

---

### `normalizeColumnDropdown`

```ts
normalizeColumnDropdown: (column?: ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | null | undefined) => DropdownProps | undefined;
```

---

### `editorDropdown`

```ts
editorDropdown: CellTemplate<DataType<any, ColumnProp>> | undefined;
```

---

### `DropdownEditor`

```ts
class DropdownEditor {
  async componentDidRender(): Promise<void>;

  getValue();

  beforeDisconnect();

  disconnectedCallback();

  render(h: HyperFunc<VNode>);
}
```

---

### `dropdownEditor`

```ts
dropdownEditor: typeof DropdownEditor;
```

---

### `ColumnDropdown`

Column type for dropdown editor

**Key Features**:
- **Cell Template**: Uses the `editorDropdown` template for rendering the dropdown editor.
- **Cell Properties**: Applies a small padding to the cell to prevent layout issues.
- **Readonly**: Ensures the dropdown is not editable by default.

```ts
ColumnDropdown: {
  beforeSetup: (column: ColumnRegular<ColumnProp, DataType<any, ColumnProp>>) => void;
  cellTemplate: CellTemplate<DataType<any, ColumnProp>>;
  editor: typeof DropdownEditor;
  cellProperties: (props: CellTemplateProp<DataType<any, ColumnProp>, ColumnRegular<ColumnProp, DataType<any, ColumnProp>>, ColumnProp>) => { style: { padding: string; }; class: { disabled: false; }; };
};
```
