@staticmethod
def build_colDefs_for_mi_rows(df, keep_multiindex):
    """
        create agGrid columnDefs dict for column grouping
        from multiindex dataframe columns
        """
    mindexrow = df.index
    s = []
    for e in list(mindexrow.names):
        new_e = {'field': e, 'headerName': e.title(), 'rowGroup': True}
        if not keep_multiindex:
            new_e['hide'] = True
        s.append(new_e)
    return s
