You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set `isTreeTable` to `true` and provide nested data via the `subRows` key (configurable with `subRowsKey`). Each row with `subRows` becomes expandable.
The `data` structure of the tree table is as follows:
@@ -136,7 +138,7 @@ In this example the default key for sub row detection is used (`subRows`), you c
136
138
137
139
The table initially contains 50 rows, when the last 10 rows are reached the table will load more data.
138
140
139
-
**Note:** To prevent the table state from resetting when the data is updated, please see [this recipe](?path=/docs/data-display-analyticaltable-recipes--docs#how-to-stop-the-table-state-from-automatically-resetting-when-the-data-changes).
141
+
**Note:** To prevent the table state from resetting when the data is updated, please see [this faq entry](?path=/docs/data-display-analyticaltable-faq--docs#how-to-stop-the-table-state-from-automatically-resetting-when-the-data-changes).
Adding custom subcomponents below table rows can be achieved by setting the `renderRowSubComponent` prop.
186
-
The prop expects a function with an optional parameter containing the `row` instance, there you can control which row should display subcomponents. If you want to display the subcomponent at the bottom of the row without an expandable container, you can set `subComponentsBehavior` prop to `"Visible"` or to `"IncludeHeight"`. "Visible" simply adds the subcomponent to the row without including its height in the initial calculation of the table body, whereas "IncludeHeight" does.
187
-
188
-
### Notes
189
-
190
-
- When `renderRowSubComponent` is set, `grouping` is disabled.
191
-
- When rendering active elements inside the subcomponent, make sure to add the `data-subcomponent-active-element' attribute, otherwise focus behavior won't be consistent.
192
-
- When `AnalyticalTableSubComponentsBehavior.IncludeHeight` or `AnalyticalTableSubComponentsBehavior.IncludeHeightExpandable` is used, `AnalyticalTableVisibleRowCountMode.Interactive` is not supported.
<Text>This subcomponent will be displayed below all rows except the first, second and third.</Text>
251
-
</FlexBox>
252
-
);
253
-
};
254
-
return (
255
-
<AnalyticalTable
256
-
data={props.data}
257
-
columns={props.columns}
258
-
renderRowSubComponent={renderRowSubComponent}
259
-
subComponentsBehavior={AnalyticalTableSubComponentsBehavior.Expandable} //default value
260
-
/>
261
-
);
262
-
};
263
-
```
185
+
## Auto Row Count
264
186
265
-
</details>
187
+
Set `visibleRowCountMode` to `AnalyticalTableVisibleRowCountMode.Auto` or `AutoWithEmptyRows` to let the table automatically fill its container with rows.
266
188
267
-
## Adjust the number of rows to the container height
189
+
**Prerequisites:**
268
190
269
-
By adding the `visibleRowCountMode` prop and setting it to `AnalyticalTableVisibleRowCountMode.Auto` the table automatically fills the surrounding container with rows and when setting it to `AnalyticalTableVisibleRowCountMode.AutoWithEmptyRows`, empty rows fill the container as well, if not enough visible rows are available.
191
+
- The table **must** be placed inside a container with a **defined height** (e.g. `height: 500px`, `flex: 1`, or a CSS Grid row). Without a constrained parent, the table cannot determine how many rows to render.
192
+
-`AutoWithEmptyRows` fills remaining space with empty rows when there aren't enough data rows to fill the container.
193
+
-`Auto` may lead to inconsistent table heights depending on the container — prefer `AutoWithEmptyRows` for a stable layout.
@@ -315,7 +239,7 @@ In the example below you can have a look at this behavior:
315
239
-`600`: The content of the "Age" column is moved to the first column (`responsiveMinWidth: 601`) and receives a custom header.
316
240
-`400`: The content of the "Friend Name" column is moved to the first column and the "Friend Age" column is hidden (`responsiveMinWidth: 401`). The "Friend Name" column also receives a custom header.
To display show the navigation column you need to set `withNavigationHighlight` to `true` and to mark a row as "navigated" the `markNavigatedRow` prop is required.
416
-
With the `markNavigatedRow` callback it is possible to define when and how many navigation indicators should be shown.
417
-
418
-
Click on any of the rows in the example below to display the "navigated" indicator in the navigation-column.
It is possible to define your own filter function and filter component on each column. For this you need to customize the column option `filter` or add a custom filter type to the `reactTableOptions.filterTypes` object (for a custom filter function) and the column option `Filter` (for a custom filter component).
452
-
453
-
Here you can find an example using a `MultiComboBox` with multiple values as filter.
// you can also define your function here, then you can just pass the key as string to the `filter` column option
511
-
// reactTableOptions={{
512
-
// filterTypes: {
513
-
// multiValueFilter: filterFn
514
-
// }
515
-
// }}
516
-
/>
517
-
</ThemeProvider>
518
-
);
519
-
};
520
-
```
337
+
## Table Without Data
521
338
522
-
</details>
339
+
Use the `NoDataComponent` prop to customize the empty state. By default, a simple text message is shown. You can pass a custom component (e.g. an `IllustratedMessage`) to display a richer empty state for different scenarios like "no data" vs. "no filter results". The component receives an `accessibleRole` prop that should be forwarded for accessibility.
523
340
524
-
## Table Without Data
341
+
**Note:** When using an `IllustratedMessage` as `NoDataComponent`, the table must have sufficient height for the illustration to render properly. With `visibleRowCountMode` set to `Auto` or `AutoWithEmptyRows`, the table container needs a minimum height of approximately `300px`. With the default `Fixed` mode, ensure `visibleRows` provides enough vertical space (typically 5+ rows).
525
342
526
343
<Canvasof={ComponentStories.NoData} />
527
344
@@ -588,6 +405,8 @@ function NoDataTable(props) {
588
405
589
406
## Kitchen Sink
590
407
408
+
A comprehensive example combining many AnalyticalTable features: sorting, filtering, grouping, custom cells, row and navigation highlighting, infinite scrolling, column reordering, vertical alignment, `scaleWidthModeOptions` for custom renderers, `retainColumnWidth`, `sortDescFirst`, and more.
0 commit comments