private createAggregationModePicker()

in analytics-example-widget/scripts/config/AnalyticsConfigComponent.tsx [69:89]


    private createAggregationModePicker(): JSX.Element {
        let initialAggregationSelection: string;
        let aggregationValues: string[] = [];
        if (this.getStoreState().configOptions && this.getStoreState().configOptions.aggregation) {
            aggregationValues = this.getStoreState().configOptions.aggregation.aggregationModes; // This is populated in the actioncreator constructor.

            if (this.getStoreState().configuration && this.getStoreState().configuration.aggregation) {
                initialAggregationSelection = this.getStoreState().configuration.aggregation.aggregationMode.toString();
            }
        }

        return <Picker
            className="aggregation-picker"
            itemValues={aggregationValues}
            initialSelectionId={initialAggregationSelection}
            getItemId={(item: AggregationMode) => item.toString()}
            getItemText={(item: AggregationMode) => item.toString()}
            onChange={(item: AggregationMode) => {
                this.actionCreator.setSelectedAggregationMode(item);
            }}></Picker>;
    }