Editor Dropdown
Module Extensions
Section titled “Module Extensions”ColumnRegular (Extended from @revolist/revogrid)
Section titled “ColumnRegular (Extended from @revolist/revogrid)”interface ColumnRegular { /** * Configuration for dropdown editor */ dropdown?: DropdownColumnConfig; /** * 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
Section titled “Plugin API”DropdownColumnSourceEntry
Section titled “DropdownColumnSourceEntry”export type DropdownColumnSourceEntry = string | Record<string, unknown>;DropdownColumnProps (Extended from index.ts)
Section titled “DropdownColumnProps (Extended from index.ts)”export type DropdownColumnProps = DropdownProps & { /** Mirror a cell template in dropdown options and selected values. */ syncCellTemplate?: boolean; /** Optional external template to mirror instead of the column cell template. */ cellTemplate?: ColumnRegular['cellTemplate'];};DropdownColumnConfig (Extended from index.ts)
Section titled “DropdownColumnConfig (Extended from index.ts)”Per-column dropdown overrides; the source may be inherited from a column type.
/** Per-column dropdown overrides; the source may be inherited from a column type. */export type DropdownColumnConfig = Omit<DropdownColumnProps, 'source'> & { source?: DropdownColumnProps['source'];};normalizeDropdownOptions
Section titled “normalizeDropdownOptions”normalizeDropdownOptions: (source?: unknown[], labelKey?: string | undefined, valueKey?: string | undefined) => DropdownOption[];normalizeColumnDropdown
Section titled “normalizeColumnDropdown”normalizeColumnDropdown: (column?: ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | null | undefined) => DropdownColumnProps | undefined;resolveColumnDropdownCellTemplate
Section titled “resolveColumnDropdownCellTemplate”Resolve the authored value template behind a dropdown column adapter.
resolveColumnDropdownCellTemplate: (column?: ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | null | undefined) => CellTemplate<DataType<any, ColumnProp>> | undefined;findColumnDropdownOption
Section titled “findColumnDropdownOption”Find normalized dropdown metadata for a stored column value.
findColumnDropdownOption: (column: ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | null | undefined, value: unknown) => DropdownOption | undefined;findColumnDropdownOptionByLabel
Section titled “findColumnDropdownOptionByLabel”Find normalized dropdown metadata by its authored display label.
findColumnDropdownOptionByLabel: (column: ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | null | undefined, label: unknown) => DropdownOption | undefined;resolveColumnDropdownProps
Section titled “resolveColumnDropdownProps”Resolve the normalized dropdown contract for a grid cell context, including
the exact renderers generated by syncCellTemplate.
resolveColumnDropdownProps: (data: ColumnDataSchemaModel<DataType<any, ColumnProp>, ColumnRegular<ColumnProp, DataType<any, ColumnProp>>, ColumnProp>, additionalData?: unknown) => DropdownProps | undefined;editorDropdown
Section titled “editorDropdown”editorDropdown: CellTemplate<DataType<any, ColumnProp>> | undefined;DropdownEditor
Section titled “DropdownEditor”class DropdownEditor { async componentDidRender(): Promise<void>;
getValue();
beforeDisconnect();
disconnectedCallback();
render(h: HyperFunc<VNode>, additionalData?: unknown);}dropdownEditor
Section titled “dropdownEditor”dropdownEditor: typeof DropdownEditor;ColumnDropdown
Section titled “ColumnDropdown”Column type for dropdown editor
Key Features:
- Cell Template: Uses the
editorDropdowntemplate 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.
ColumnDropdown: { beforeSetup: (column: ColumnRegular<ColumnProp, DataType<any, ColumnProp>>) => void; cellTemplate: CellTemplate<DataType<any, ColumnProp>>; editor: typeof DropdownEditor; cellProperties: () => { style: { padding: string; }; };};