AG grid row group when clicking on the checkbox of the grouped column returning nothing

Hi Dash Community:
I am trying to get the group info when clicking on the group on selectedRows property it is giving data only when clicked on leaf data is it possible to get data for the group also .
not woking
working

import dash_ag_grid as dag
from dash import ( Dash,
    Input,
    Output,
    State,
    callback,
    ctx,
    html,
    no_update,
)

data =[
    {
      "statename": "All India",
      "districtcode": None,
      "districtname": None,
    },
    {
      "statename": "Gujarat",
      "districtcode": 462,
      "districtname": "Valsad"
    },
    {
      "statename": "Haryana",
      "districtcode": 58,
      "districtname": "Ambala"
    },
    {
      "statename": "Haryana",
      "districtcode": 59,
      "districtname": "Bhiwani"
    },
    {
      "statename": "Haryana",
      "districtcode": 701,
      "districtname": "Charki Dadri"
    },
    {
      "statename": "Haryana",
      "districtcode": 60,
      "districtname": "Faridabad"
    },
    {
      "statename": "Haryana",
      "districtcode": 61,
      "districtname": "Fatehabad"
    },]
app = Dash()

columndefs = [
    {
        "headerName": "State",
        "field": "statename",
        "rowGroup": True,
        "hide": True,  # Initially hide the district column
        },
             
    ]

options = {                   "suppressAggFuncInHeader":True,
    "groupDisplayType":"multipleColumns",
                          "suppressMenuHide": True,
                          "rowSelection": "single",
                          "rowMultiSelectWithClick": True,
                          "groupDefaultExpanded": 0,
                          "rowHeight": 40,
                          "groupSelectsChildren": False,
                          "groupAllowUnbalanced": True,
                          "groupMaintainOrder": True,
                          "domLayout": "normal",
                          "groupRowRenderer": "agGroupCellRenderer",
                          "autoGroupColumnDef":{
                          "headerName": "State/District",
                          "field": "districtname",
                           'cellRendererParams': {
                            "suppressCount": True,
                            "checkbox": True,
                             },
                          
                      },
                      }


app.layout = html.Div([dag.AgGrid(
        id="tab2-state-district-grid",
        className="ag-theme-balham",
        rowData=data,
        columnDefs=columndefs,
        dashGridOptions=options,
        defaultColDef=dict(
            resizable=False,
            flex=1,
            suppressSizeToFit=True,
            suppressMovable=True,
            floatingFilter=False,
            filter=False,
        ),
        enableEnterpriseModules=True,
        licenseKey="LICENSE_KEY_HERE",
        persistence=True,
        persistence_type="session",
        persisted_props=["selectedRows"],
    ),
    html.H1(id="data-dd")]
)

@callback(
    [
        Output("data-dd", "children"),
    ],
    [
       Input("tab2-state-district-grid", "selectedRows"),   
        Input("tab2-state-district-grid", "cellClicked"),
        Input("tab2-state-district-grid", "cellRendererData"),   
         State("tab2-state-district-grid", "rowData"),


    ],
)
def test_grid(selcted_rows,cols,cell_rend,row_data):
    print(ctx.triggered_id,"selcted_rows",selcted_rows)
    print(ctx.triggered_id,"cols",cols)
    print(ctx.triggered_id,"cell_rend",cell_rend)
    # print(ctx.triggered_id,"master",master)
    # print(row_data)
    return no_update


app.run(debug=True)

Hello @mohitchaniyal,

Welcome to the community!

This is correct, currently selectedRows will only return data based upon the non-grouped rows. You can however make it so that it will select all the data below it, check out here:

This will allow you to make selections by selecting all the data inside of the grouped row.