Skip to content

Commit

Permalink
fix(datatable): fix datatable column pinning #closes2110
Browse files Browse the repository at this point in the history
  • Loading branch information
kaminderpal committed May 10, 2024
1 parent a7a13c9 commit cc9f039
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ function DataTable({ data, layerPath, tableHeight = 600 }: DataTableProps): JSX.
globalFilter,
},
enableColumnFilterModes: true,
// NOTE: enable column pinning so that icon, zoom, details can be pinned to left
enableColumnPinning: true,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
onGlobalFilterChange: setGlobalFilter,
Expand All @@ -445,7 +447,8 @@ function DataTable({ data, layerPath, tableHeight = 600 }: DataTableProps): JSX.
<Box>
<MRTToggleFiltersButton className="style1" table={table} />
<FilterMap layerPath={layerPath} isGlobalFilterOn={!!globalFilter?.length} />
<MRTShowHideColumnsButton className="style1" table={table} />
{/* enable column pinning options is override, so that pinning option in menu can be hide. */}
<MRTShowHideColumnsButton className="style1" table={{ ...table, options: { ...table.options, enableColumnPinning: false } }} />
<MRTToggleDensePaddingButton className="style1" table={table} />
<ExportButton rows={rows} columns={columns}>
<JSONExportButton features={data.features as TypeFeatureInfoEntry[]} layerPath={layerPath} />
Expand Down

0 comments on commit cc9f039

Please sign in to comment.