# Quarterly Update - Summer 2022

> Infinite Table update for Summper 2022 - row selection, column rendering, group columns

Published: 2022-09-01  
Author: admin  
Tags: product

Canonical page: https://infinite-table.com/blog/2022/09/01/infinite-table-monthly-update-august-2022

Over the summer, we continued our work on preparing for our official release, focusing mainly on adding new functionalities and documenting them thoroughly, together with enhancements to existing features.

## Summary

We have implemented a few new functionalities, including:

- [row selection is now available 🎉](#row-selection)
- [column rendering pipeline](#column-rendering-pipeline)
- [group columns are now sortable 🔃](#sortable-group-columns)

And we have updated some of the existing features:

- [group columns inherit](#enhanced-group-columns) styles and configuration
- [column hiding when grouping](#column-hiding-when-grouping)
- [group columns can be bound to a field](#group-columns-bound-to-a-field)
- [using the column valueGetter in sorting](#column-valuegetter-in-sorting)

We started working on column and context menus.
We will first release fully customizable **column** menus to show/hide columns and to easily perform other operations on columns.
This will be followed by **context** menus where you will be able to define your own custom actions on rows/cells in the table.

---

Don't worry, the menus will be fully customizable, the menu items are fully replaceable with whatever you need, or you will be able to swap our menu component with a custom one of your own.

## New Features

Here's what we shipped over the summer:

### Row Selection

Row selection can be single or multiple, with or without a checkbox, with or without grouping and for a lazy or non-lazy `DataSource` - 😅 that was a long enumeration, but seriously, we think we got something great out there.

You can specify the selection via the [`rowSelection`](https://infinite-table.com/docs/reference/datasource-props/index.md#rowSelection) (controlled) or [`defaultRowSelection`](https://infinite-table.com/docs/reference/datasource-props/index.md#defaultRowSelection) (uncontrolled) props, and listen to changes via the [`onRowSelectionChange`](https://infinite-table.com/docs/reference/datasource-props/index.md#onRowSelectionChange) callback prop.

[Multi row checkbox selection with grouping](https://codesandbox.io/s/infinite-table-multi-row-checkbox-selection-with-grouping-i9wi88)

Single vs multiple selection, grouped or ungrouped data, checkbox selection, lazy selection - read about all the possible combinations you can use to fit your needs.

### Column Rendering Pipeline

The rendering pipeline for columns is a series of functions defined on the column that are called while rendering.

All the functions that have the word `render` in their name will be called with an object that has a `renderBag` property, which contains values that will be rendered.

The default [`columns.render`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.render) function (the last one in the pipeline) ends up rendering a few things:

- a `value` - generally comes from the [field](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.field) the column is bound to
- a `groupIcon` - for group columns
- a `selectionCheckBox` - for columns that have [`columns.renderSelectionCheckBox`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderSelectionCheckBox) defined (combined with row selection)

When the rendering process starts for a column cell, all the above end up in the `renderBag` object.

For example:

```tsx {3,12}
const column: InfiniteTableColumn<T> = {
  valueGetter: () => 'world',
  renderValue: ({ value, renderBag, rowInfo }) => {
    // at this stage, `value` is 'world' and `renderBag.value` has the same value, 'world'
    return <b>{value}</b>;
  },

  render: ({ value, renderBag, rowInfo }) => {
    // at this stage `value` is 'world'
    // but `renderBag.value` is <b>world</b>, as this was the value returned by `renderValue`
    return <div>Hello {renderBag.value}!</div>;
  },
};
```

Read about how using the rendering pipeline helps your write less code.

Here is the full list of the functions in the rendering pipeline, in order of invocation:

1.[`columns.valueGetter`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.valueGetter) - doesn't have access to `renderBag` 2.[`columns.valueFormatter`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.valueFormatter) - doesn't have access to `renderBag` 3.[`columns.renderGroupIcon`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderGroupIcon) - can use all properties in `renderBag` 4.[`columns.renderSelectionCheckBox`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderSelectionCheckBox) - can use all properties in `renderBag` 5.[`columns.renderValue`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderValue) - can use all properties in `renderBag` 6.[`columns.renderGroupValue`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderGroupValue) - can use all properties in `renderBag` 7.[`columns.renderLeafValue`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderLeafValue) - can use all properties in `renderBag` 8.[`columns.render`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.render) - can use all properties in `renderBag`

Additionally, the [`columns.components.ColumnCell`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.components.ColumnCell) custom component has access to the `renderBag` via [`useInfiniteColumnCell`](https://infinite-table.com/docs/reference/hooks/index.md#useInfiniteColumnCell)

### Sortable Group Columns

When [groupRenderStrategy="single-column"](https://infinite-table.com/docs/reference/infinite-table-props.md#groupRenderStrategy) is used, the group column is sortable by default if all the columns that are involved in grouping are sortable.

Sorting the group column makes the `sortInfo` have a value that looks like this:

```ts
const sortInfo = [{ field: ['stack', 'age'], dir: 1, id: 'group-by' }];
```

When [groupRenderStrategy="multi-column"](https://infinite-table.com/docs/reference/infinite-table-props.md#groupRenderStrategy), each group column is sortable by default if the column with the corresponding field is sortable.

 

In both single and multi group column render strategy, you can use the [`columns.sortable`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.sortable) property to override the default behavior.

 

## Updated Features

Here’s a list of Infinite Table functionalities that we enhanced in the last month:

### Enhanced Group Columns

Group columns now inherit configuration from the columns bound to the field they are grouped by - if such columns exist.

[Group column inherits style from related column](https://codesandbox.io/s/infinite-table-group-column-inherits-style-from-related-column-v16qfg)

The generated group column(s) - can be one for all groups or one for each group - will inherit the `style`/`className`/renderers from the columns corresponding to the group fields themselves (if those columns exist).

Additionally, there are other ways to override those inherited configurations, in order to configure the group columns:

- use [`groupBy.column`](https://infinite-table.com/docs/reference/datasource-props/index.md#groupBy.column) to specify how each grouping column should look for the respective field (in case of [groupRenderStrateg="multi-column"](https://infinite-table.com/docs/reference/infinite-table-props.md#groupRenderStrategy))
- use [`groupColumn`](https://infinite-table.com/docs/reference/infinite-table-props.md#groupColumn) prop
  - can be used as an object - ideal for when you have simple requirements and when [groupRenderStrateg="single-column"](https://infinite-table.com/docs/reference/infinite-table-props.md#groupRenderStrategy)
  - as a function that returns a column configuration - can be used like this in either single or multiple group render strategy

### Column Hiding when Grouping

When grouping is enabled, you can choose to hide some columns. Here are the two main ways to do this:

- use [`hideColumnWhenGrouped`](https://infinite-table.com/docs/reference/infinite-table-props.md#hideColumnWhenGrouped) - this will make columns bound to the group fields be hidden when grouping is active
- use [`columns.defaultHiddenWhenGroupedBy`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.defaultHiddenWhenGroupedBy) (also available on the column types, as [`columnTypes.defaultHiddenWhenGroupedBy`](https://infinite-table.com/docs/reference/infinite-table-props.md#columnTypes.defaultHiddenWhenGroupedBy)) - this is a column-level property, so you have more fine-grained control over what is hidden and when.

Valid values for [`columns.defaultHiddenWhenGroupedBy`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.defaultHiddenWhenGroupedBy) are:

- `"*"` - when any grouping is active, hide the column that specifies this property
- `true` - when the field this column is bound to is used in grouping, hides this column
- `keyof DATA_TYPE` - specify an exact field that, when grouped by, makes this column be hidden
- `{[k in keyof DATA_TYPE]: true}` - an object that can specify more fields. When there is grouping by any of those fields, the current column gets hidden.

[Hide columns when grouping](https://codesandbox.io/s/infinite-table-hide-columns-when-grouping-41o64x)

In addition, you can now use [`columns.renderGroupValue`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderGroupValue) and [`columns.renderLeafValue`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.renderLeafValue) for configuring the rendered value for grouped vs non-grouped rows.

### Column valueGetter in Sorting

Columns allow you to define a [valueGetter](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.valueGetter) to change the value they are rendering (e.g. useful when the `DataSet` has nested objects).

Previously, this value returned by [`columns.valueGetter`](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.valueGetter) was not used when sorting the table. With the latest update, the value returned by [valueGetter](https://infinite-table.com/docs/reference/infinite-table-props.md#columns.valueGetter) is correctly used when sorting the grid locally.
