How to make single select selectorB on dashboard d...
# gooddata-cloud
k
How to make single select selectorB on dashboard default select top element of it. SelectorB have values that is filtered by selectorA.
k
Thinking completed Based on the available documentation, setting up an attribute filter to depend on another filter and automatically select its first available value depends on whether you are working in the GoodData Dashboard UI or developing with the GoodData.UI SDK: In GoodData.UI SDK If you are implementing custom components using the GoodData.UI SDK (
AttributeFilter
or
AttributeFilterButton
), you can enable this behavior directly using the component properties: 1. Single selection mode: Set
selectionMode="single"
[Configuring Single Value Selection Mode]. 2. Auto-select top item: Set
selectFirst={true}
. This instructs the component to automatically select the first available element when the selection is empty [Attribute Filter Properties; Attribute Filter Button]. 3. Dependency: Configure Selector B to depend on Selector A (the parent filter). When Selector A changes, Selector B resets and automatically selects the first available element from the filtered set [Attribute Filter Properties; Configuring Single Value Selection Mode]. Example:
Copy code
<AttributeFilter
    filter={newPositiveAttributeFilter(Md.SelectorB.Default, [])}
    selectionMode="single"
    selectFirst={true}
    onApply={(updatedFilter) => {
        setFilter(updatedFilter);
    }}
/>
In the GoodData Dashboard UI In the native dashboard UI: 1. Configure Dependent Filter: ◦ Edit the dashboard. ◦ Click the gear/settings icon on Selector B [Create Dependent Filters on Dashboards]. ◦ Under Filter Values By, add a Dashboard Filter and select Selector A as the parent filter, then save [Create Dependent Filters on Dashboards]. 1. Single Selection and Default Values: ◦ Set the filter selection mode to single selection in the filter settings [SelectionMode.tsx]. ◦ Select the desired default element and save the dashboard. Note regarding dynamic default selection on dashboards: The knowledge sources do not explicitly describe an out-of-the-box UI toggle for standard dashboards to dynamically re-select the "top available element" of a dependent filter whenever a parent filter selection changes. In the native UI, saving a default selection persists that specific element. Dynamic automatic selection on empty/reset states is supported via the SDK
selectFirst={true}
property [Attribute Filter Properties; Attribute Filter Button] or custom dashboard plugin implementations. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups. 👀 Our Support team monitors all messages and will jump in if needed.
k
I want to do this in gooddata UI
@kapa.ai I want to do this in gooddata UI
k
Thinking completed I'm sorry, but the provided knowledge sources do not contain information indicating that the GoodData native Dashboard UI supports automatically selecting the top/first available element dynamically when a parent filter changes. In the GoodData Dashboard UI: 1. You can configure Selector B to be dependent on Selector A so its available dropdown options are filtered by Selector A. 2. You can set the filter selection mode to single-select. 3. You can choose and save a static default value when saving the dashboard. However, dynamically re-selecting the top or first element from the newly filtered list is a feature explicitly supported in code via the GoodData.UI SDK (using the
selectFirst={true}
property on the
AttributeFilter
component [IAttributeFilterCoreProps.selectFirst property; Configuring Single Value Selection Mode]) or through a custom dashboard plugin [README], rather than a built-in toggle in the standard dashboard interface. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups. 👀 Our Support team monitors all messages and will jump in if needed.
j
Hi Krishti, Confirming the above. In this case, I can only offer you a product feedback. Let me know if you wish me to do so.
k
yes please add in product feedback and enhancement.
✅ 1