Blondish
Blondish

Reputation: 141

AgGrid - autoGroupColumn is not visible in tool Panel sideBar

is there a reason that a group column created with autoGroupColumnDef would not appear in the toolPanel? I seem to have the config right. I am creating a simple sideBar that would show 2 columns - one that is defined in columns constant and 1 that is defined in autoGroupColumnDef. only the first one appears in the toolBar. This column does not appear in toolbar:

const autoGroupColumnDef = useMemo<ColDef>(() => {
    return addCommonStylesToColDefs([
      {
        showRowGroup: true,
        field: "portfolio_name",
        suppressColumnsToolPanel: false,
        headerName: t(""),
        cellStyle: { fontWeight: "bold" },
        cellRendererParams: {
          suppressCount: true,
          innerRenderer: (params: ICellRendererParams): ReactElement | null =>
            TablePortfolioNameCellRenderer({
              data: params.data
            })
        }
      }
    ])[0]
  }, [])

This one appears in toolBar:

const columns: Array<ColDef> = addCommonStylesToColDefs([
    {
      headerName: t("assetName"),
      field: "asset_name",
      cellRenderer: AgAssetNameCellRenderer,
      cellStyle: { textAlign: "left" }
    },

my sideBar:

const sideBar = useMemo<SideBarDef | string | string[] | boolean | null>(() => {
    return {
      toolPanels: [
        {
          id: "columns",
          labelDefault: "Columns",
          labelKey: "columns",
          iconKey: "columns",
          toolPanel: "agColumnsToolPanel",
          toolPanelParams: {
            // suppressRowGroups: true,
            // showRowGroupsSection: true,
            suppressValues: true,
            suppressPivots: true,
            suppressPivotMode: true,
            suppressColumnFilter: true,
            suppressColumnSelectAll: true,
            suppressColumnExpandAll: true
          }
        }
      ],
      defaultToolPanel: "columns"
    }
  }, [])

agGrid component:

 <AgGrid
          ref={gridRef}
          autoResizeColumns={false}
          columnDefs={columns}
          defaultColDef={defaultColDef}
          pagination
          paginationPageSize={PaginationPageSize}
          domLayout="autoHeight"
          rowModelType="serverSide"
          onGridReady={onGridReady}
          treeData
          autoGroupColumnDef={autoGroupColumnDef}
          getRowId={(params): string => params.data.id}
          cacheBlockSize={CacheBlockSize}
          isServerSideGroup={(data): boolean => data.entries && data.entries.length > 0}
          getServerSideGroupKey={(dataItem): string => dataItem.id}
          onStoreRefreshed={onStoreRefreshed}
          onRowGroupOpened={({ node, expanded }): void => handleRowExpand(node, expanded)}
          sideBar={sideBar}
        />

Upvotes: 0

Views: 47

Answers (0)

Related Questions