Replies: 3 comments
-
Currently this is not possible, but will be easy to add this option. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@sgratzl, did you manage to somehow accomplish this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
atm I'm using the following group by function: import { Row, IdType, defaultGroupByFn } from 'react-table';
export function columnSpecificGroupByFn<D extends object = {}>(
rows: Row<D>[],
columnId: IdType<D>
): Record<string, Row<D>[]> {
if (rows.length === 0) {
return {};
}
const column = rows[0].allCells.find((d) => d.column.id === columnId);
if (column && typeof (column.column as any).groupBy) {
return (column.column as any).groupBy(rows, column.column);
}
return defaultGroupByFn(rows, columnId);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
atm one can only specify one groupByFn for the whole instance. However, I'd like to implement custom grouping functions for different column (types). E.g., a custom one for a numeric column which bins the values in multiple groups. Howe can I do that?
Beta Was this translation helpful? Give feedback.
All reactions