✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Grouping/Linking dbc.CheckList Together

Is there a mechanism to link CheckList together?

For example, I have the following CheckList with the default state.
image

If a user selects “12” I would also like the “all” value to deselect.
A user can select multiple unique versions (ex: “12” and “999”)
If the user goes back and selects “all” the unique versions will be de-selected

The only way I could see this working is with a circular input & output but that’s not allowed.

This is the section of code relevant to these CheckList

        dbc.FormGroup(
            [
                dbc.Label("Select software version(s)"),
                dbc.Checklist(
                    id="dut-software-versions", value=["all"], inline=True, switch=True
                ),
            ]
        ),

@app.callback(
    Output("dut-software-versions", "options"),
    [Input("dut-model-input", "value"), Input("dut-speed-input", "value"),],
)
def DUTGetSoftwareVersions(DUTModel, PortSpeed):
    SoftwareVersions = list(
        Versa_Throughput_Report.objects.filter(
            DUTModel=DUTModel,
            PortSpeed=PortSpeed,
            TestResult="PASS",
            TestType="benchmark",
        )
        .values_list("SoftwareVersion", flat=True)
        .exclude(tags__name__in=["Hidden"])
        .distinct()
    )

    SoftwareVersions.append("all")

    return [{"label": k, "value": k} for k in sorted(SoftwareVersions)]