diff --git a/docs/components/table-view.md b/docs/components/table-view.md index 3fb96c6559..1e057fe5a8 100644 --- a/docs/components/table-view.md +++ b/docs/components/table-view.md @@ -754,6 +754,42 @@ Function for making a row expandable. The function receives row value object as ``` +### rowExpanded + +Use this prop to specify initial expanded / collapsed state for each data row. The function receives row value object as an argument and should return a boolean value. Default value is `() => false`. When returned value is `true`, a row is rendered expanded. + + + + + +```html + + + +``` + ### hideHeaders A boolean to hide table headers. Only recomended when used in nested table. Refer to [Expandable Rows](#expandable-rows) section documentation for more details. Defaults to `false`. @@ -1511,9 +1547,16 @@ Emitted when the user performs sorting, resizes columns or toggles column visibi Emitted when user interacts with checkboxes in bulk actions column. Payload is array of selected table row objects. -### row-expand +### update:row-expanded -Emitted when row is expanded (when [`rowExpandable` prop](#rowexpandable) is `true`). Payload is expanded row data. +Emitted when row is expanded or collapsed (when [`rowExpandable` prop](#rowexpandable) is `true`). Payload is object of type `RowExpandPayload`. + +```ts +interface RowExpandPayload { + row: Record + expanded: boolean +} +```