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?: 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
Section titled “Plugin API”DropdownColumnSourceEntry
Section titled “DropdownColumnSourceEntry”export type DropdownColumnSourceEntry = string | Record<string, unknown>;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) => 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>);}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: (props: CellTemplateProp<DataType<any, ColumnProp>, ColumnRegular<ColumnProp, DataType<any, ColumnProp>>, ColumnProp>) => { style: { padding: string; }; class: { disabled: false; }; };};