Cascader class

Signature

  1. export declare class Cascader extends React.PureComponent<CascaderProps, CascaderState>

Import

  1. import { Cascader } from '@grafana/ui';

Constructors

ConstructorModifiersDescription
constructor(props)Constructs a new instance of the Cascader class

Properties

PropertyModifiersTypeDescription
defaultPropsstatic{
changeOnSelect: boolean;
}
flattenOptions(options: CascaderOption[], optionPath?: CascaderOption[]) => SelectableValue<string[]>[]
getSearchableOptionsimport(“memoize-one”).MemoizedFn<(options: 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
onSelectInputChange(value: string) => void

Methods

MethodModifiersDescription
render()
setInitialValue(searchableOptions, initValue)

constructor(props)

Constructs a new instance of the Cascader class

Signature

  1. constructor(props: CascaderProps);

Parameters

ParameterTypeDescription
propsCascaderProps

defaultProps property

Signature

  1. static defaultProps: {
  2. changeOnSelect: boolean;
  3. };

flattenOptions property

Signature

  1. flattenOptions: (options: CascaderOption[], optionPath?: CascaderOption[]) => SelectableValue<string[]>[];

getSearchableOptions property

Signature

  1. getSearchableOptions: import("memoize-one").MemoizedFn<(options: CascaderOption[]) => SelectableValue<string[]>[]>;

onBlur property

Signature

  1. onBlur: () => void;

onBlurCascade property

Signature

  1. onBlurCascade: () => void;

onChange property

Signature

  1. onChange: (value: string[], selectedOptions: CascaderOption[]) => void;

onCreateOption property

Signature

  1. onCreateOption: (value: string) => void;

onInputKeyDown property

Signature

  1. onInputKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;

onSelect property

Signature

  1. onSelect: (obj: SelectableValue<string[]>) => void;

onSelectInputChange property

Signature

  1. onSelectInputChange: (value: string) => void;

render method

Signature

  1. render(): JSX.Element;

Returns:

JSX.Element

setInitialValue method

Signature

  1. setInitialValue(searchableOptions: Array<SelectableValue<string[]>>, initValue?: string): {
  2. rcValue: string[];
  3. activeLabel: any;
  4. };

Parameters

ParameterTypeDescription
searchableOptionsArray<SelectableValue<string[]>>
initValuestring

Returns:

{ rcValue: string[]; activeLabel: any; }