Need help with row grouping and drill-down functionality in Dash

Hey, Everyone!

I wanted to know if there’s any way we can have row groupings that can be expanded and collapsed as we generally do with columns. It would be great when we have category-subcategory like hierarchy in data.

I am aware about the Row Groupings in Dash Ag-Grid but it requires an enterprise licence. Is there any other way to do this using Ag-Grids or any other tabular components?

PFA the reference below.

Looking forward in learning more about such implementations or any other similar way to represent such data:)

Hello @Shail-Shukla,

It is possible to achieve this type of interface…

However, for this to work, you’ll need to setup your data to have the way the children and parents are associated.

rowHeight should be a function that checks whether the parent is expanded, if expanded then something like 20, else 1 and have the rowClassRules check what the rowHeight is, if the rowHeight is 1, then you need to have the class as hidden, then you need a css stylesheet:

.hidden {
    display: none
}

Have fun. :slight_smile:

I also recommend not allowing your data to be sorted or filtered on the columns, as this can mess with your rowHeight function. :slight_smile:

1 Like