Dash ag grid checkbox-row-selection using filtered rows

Is there a way to have the select all box in the grid only select from the virtual row data, i.e only select rows that have been filtered?

Using the example here, if I were to type “Sun Dan” and then press the select all box (top left), I’d like to only select the two rows, however currently it selects all the rowData.

I’ve tried using the selectAll property, however I haven’t had much luck with it :expressionless:

    dag.AgGrid(
        selectAll={"filtered": True},

From the reference page:

selectAll (dict; default False): Set to True to cause all rows to be selected, Or pass an object of options for which rows to select. Currently supports filtered, set to True to only select filtered rows.

selectAll is a boolean | dict with keys:

  • filtered (boolean; optional)

Hello @Redhotmoons,

That should be the default of the header select box.

You can check out more here with the columnDefs.

1 Like

Hi @Redhotmoons

You can find an example here (it hasn’t made it’s way into the dash docs yet)

dag-docs

1 Like

ah perfect, thanks :slight_smile:

     ...
      defaultColDef={
          "headerCheckboxSelection":  {"function": "isFirstColumn(params)"},
          "checkboxSelection":  {"function": "isFirstColumn(params)"},
          "headerCheckboxSelectionFilteredOnly": True,
      },
1 Like