Dash AgGrid : Row Grouping - Header with dropdown

Hello,

I’m using Dash AgGrid (with enterprise license modules) and I’m trying to create an AG Grid datatable with row grouping.

As you can see in my screenshot, I’ve created a datatable with different row groupings, and I’ve used a dropdown in the ‘OffSet List’ column.

Currently, I have my dropdown list for all my “KPI” rows, but I want to add the same dropdown list (with other values) to my row groups (in place of “dropdown list here”).

Is this possible? I’ve found things like “aggFunc”: “sum”, but I want a dropdown list instead.

This is my data’s :

Column_def :

    column_defs = [
        {
            "headerName": ProjectOverviewPresenter.columns["project"],
            "field": "project",
            "rowGroup": True,
            "hide": True,
            "suppressColumnsToolPanel": True,
        },
        {
            "headerName": ProjectOverviewPresenter.columns["well_type"],
            "field": "well_type",
            "rowGroup": True,
            "hide": True,
            "suppressColumnsToolPanel": True,
        },
        {
            "headerName": ProjectOverviewPresenter.columns["section"],
            "field": "section",
            "rowGroup": True,
            "hide": True,
            "suppressColumnsToolPanel": True,
        },
        {
            "headerName": ProjectOverviewPresenter.columns["kpi"],
            "field": "kpi",
        },
        {
            "headerName": ProjectOverviewPresenter.columns["kpi_min"],
            "field": "kpi_min",
        },
        {
            "headerName": ProjectOverviewPresenter.columns["kpi_max"],
            "field": "kpi_max",
        },
        {
            "headerName": ProjectOverviewPresenter.columns["kpi_mean"],
            "field": "kpi_mean",
        },
        {
            "headerName": ProjectOverviewPresenter.columns["offset_list"],
            "field": "offset_list",
            "cellEditor": "agSelectCellEditor",
            "editable": True,
            "cellEditorParams": {"values": [""] + project.offset_list_names},
        },
    ]

Thanks you.

Hello @krowry,

To clarify, do you just want to display the selected items? This would be for the aggFunc usage.

Or, do you want to want the ability to select from a dropdown on the group level and then apply it to all the child nodes?

Hello @jinnyzor ,

Thanks for your answer.

I want to display a dropdown at the group level, in the same column as the “offset list.”.

For KPIs, I have my dropdown with a callback. When I change the value of my dropdown, the selected offset list is applied to my selected KPI row. I want to do the same thing but at group level.

I hope it’s clear :slight_smile:

When you make a change, it will apply all the way to everything grouped underneath it?

No, only for the element of my row.

For example, if I modify the dropdown on the “BOP TEST” KPI row and select “TEST MAP,” then the “TEST MAP” offset list will be applied to my “BOP TEST” KPI.

I want the same thing but one level above, for example, for the “Test Well Type 3 (30)” row.

I dont think that you can list it at the highest level unless you want to apply it to everything in the entire grid.

Change this and it applies only to the selected row (only in “BOP TEST” kpi in the exemple).

So, I can’t have my dropdown on the above element and then modify the offset list of my “Test Well Type 3 (30)” element, for example? (like this:)

Your grouping needs to change…

And honestly, I had a second grid to pull the tests that you want to apply, if you want to maintain your grouping this way.

Right now, the KPI level is on the 3rd level in the grouping. There is no representation on the first level because you can have different tests applied on each KPI.

Something like this:
image

Have this off to the right so that people can see the specific tests and select it.

If you still want to display the selected types in the main grid, then you can update the rowData upon the grid tests cellValueChanged.

Ok @jinnyzor,

Thanks for you’r answer :slight_smile:

I will try to find a way to modify the offset list of my parent rows in a different way, without using the dropdown then !

The parent rows can get modified, but the issue is that your children are not the same.

To allow for the parent to modify, you would have to apply it to all the tests in the entire grid. Which is something I dont think you want to do.

eg:

Modifying “Planning” would apply to every KPI. So on, and so forth. At least this is the way that I understand what you are trying to achieve.

Exactly, I don’t want to apply this on all the tests :frowning:

Thanks again for your answer!

1 Like