Skip to content

Commit

Permalink
fix: remove unneeded checkbox column
Browse files Browse the repository at this point in the history
  • Loading branch information
simonseyock committed Jan 15, 2025
1 parent 8d7779c commit 3fc107a
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/Grid/AgFeatureGrid/AgFeatureGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,6 @@ export function AgFeatureGrid<T>({
style: featureStyle
}), [features, layerName], true);

const checkBoxColumnDefinition: ColDef<WithKey<T>> = useMemo(() => ({
checkboxSelection: true,
headerCheckboxSelection: true,
headerName: '',
lockPosition: true,
pinned: 'left',
suppressHeaderMenuButton: true,
suppressMovable: true,
width: 40
}), []);

/**
* Returns the currently selected row keys.
*
Expand Down Expand Up @@ -321,11 +310,6 @@ export function AgFeatureGrid<T>({
const feature = features[0];
const props = feature.getProperties();

if (selectable) {
// adds select checkbox column
columns.push(checkBoxColumnDefinition);
}

const colDefsFromFeature = Object.keys(props).map((key: string): ColDef<WithKey<T>> | undefined => {
if (attributeBlacklist.includes(key)) {
return;
Expand Down Expand Up @@ -358,7 +342,7 @@ export function AgFeatureGrid<T>({
...columns,
...(colDefsFromFeature.filter(c => !_isNil(c)) as ColDef<WithKey<T>>[])
];
}, [attributeBlacklist, features, selectable, checkBoxColumnDefinition]);
}, [attributeBlacklist, features]);

/**
* Returns the table row data from all the given features.
Expand Down Expand Up @@ -611,10 +595,10 @@ export function AgFeatureGrid<T>({
onRowClicked={onRowClickInner}
onSelectionChanged={onSelectionChanged}
rowData={passedRowData}
rowSelection={{
rowSelection={selectable ? {
mode: "multiRow",

Check warning on line 599 in src/Grid/AgFeatureGrid/AgFeatureGrid.tsx

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
enableClickSelection: false
}}
} : undefined}
theme={theme}
{...agGridPassThroughProps}
/>
Expand Down

0 comments on commit 3fc107a

Please sign in to comment.