Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Cascader class
Signature
export declare class Cascader extends React.PureComponent<CascaderProps, CascaderState>
Import
import { Cascader } from '@grafana/ui';
Constructors
Constructor | Modifiers | Description |
---|---|---|
constructor(props) | Constructs a new instance of the Cascader class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
flattenOptions | (options: CascaderOption[], optionPath?: CascaderOption[]) => SelectableValue<string[]>[] | ||
onBlur | () => void | ||
onBlurCascade | () => void | ||
onChange | (value: string[], selectedOptions: CascaderOption[]) => void | ||
onCreateOption | (value: string) => void | ||
onInputKeyDown | (e: React.KeyboardEvent<HTMLInputElement>) => void | ||
onSelect | (obj: SelectableValue<string[]>) => void |
Methods
Method | Modifiers | Description |
---|---|---|
render() | ||
setInitialValue(searchableOptions, initValue) |
constructor(props)
Constructs a new instance of the Cascader
class
Signature
constructor(props: CascaderProps);
Parameters
Parameter | Type | Description |
---|---|---|
props | CascaderProps |
flattenOptions property
Signature
flattenOptions: (options: CascaderOption[], optionPath?: CascaderOption[]) => SelectableValue<string[]>[];
onBlur property
Signature
onBlur: () => void;
onBlurCascade property
Signature
onBlurCascade: () => void;
onChange property
Signature
onChange: (value: string[], selectedOptions: CascaderOption[]) => void;
onCreateOption property
Signature
onCreateOption: (value: string) => void;
onInputKeyDown property
Signature
onInputKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
onSelect property
Signature
onSelect: (obj: SelectableValue<string[]>) => void;
render method
Signature
render(): JSX.Element;
Returns:
JSX.Element
setInitialValue method
Signature
setInitialValue(searchableOptions: Array<SelectableValue<string[]>>, initValue?: string): {
rcValue: string[];
activeLabel: any;
};
Parameters
Parameter | Type | Description |
---|---|---|
searchableOptions | Array<SelectableValue<string[]>> | |
initValue | string |
Returns:
{
rcValue: string[];
activeLabel: any;
}