mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-13 05:20:26 +00:00
Normalize API method names and row modesl, add expandAll functionality including prop getter
This commit is contained in:
@@ -41,6 +41,13 @@ The following properties are available on the table instance returned from `useT
|
||||
|
||||
- `rows: Array<Row>`
|
||||
- An array of **expanded** rows.
|
||||
- `toggleRowExpanded: Function(rowId, isExpanded?)`
|
||||
- A function to toggle whether a row is expanded or not. The `isExpanded` boolean is optional, otherwise it will be a true toggle action
|
||||
- `toggleAllRowsExpanded: Function(isExpanded?)`
|
||||
- A function to toggle whether all of the rows in the table are expanded or not. The `isExpanded` boolean is optional, otherwise it will be a true toggle action
|
||||
- `isAllRowsExpanded`
|
||||
- `getToggleAllRowsExpandedProps: Function(userProps) => props`
|
||||
- A prop getter function that returns all necessary props for an element to be clicked and toggle all of the rows expanded or not.
|
||||
|
||||
### Row Properties
|
||||
|
||||
@@ -48,7 +55,7 @@ The following additional properties are available on every `row` object returned
|
||||
|
||||
- `isExpanded: Bool`
|
||||
- If `true`, this row is in an expanded state.
|
||||
- `toggleExpanded: Function(?isExpanded: Bool) => void`
|
||||
- `toggleRowExpanded: Function(?isExpanded: Bool) => void`
|
||||
- This function will toggle the expanded state of a row between `true` and `false` or, if an `isExpanded` boolean is passed to the function, it will be set as the new `isExpanded` value.
|
||||
- Rows with a hard-coded `manualExpandedKey` (defaults to `expanded`) set to `true` are not affected by this function or the internal expanded state.
|
||||
|
||||
|
||||
@@ -93,11 +93,6 @@ The following options are supported on any column object you can pass to `column
|
||||
- Receives the table instance and cell model as props
|
||||
- Must return valid JSX
|
||||
- This function (or component) is primarily used for formatting the column value, eg. If your column accessor returns a date object, you can use a `Cell` function to format that date to a readable format.
|
||||
- `show: Bool`
|
||||
- Optional
|
||||
- Defaults to `undefined`
|
||||
- If set to `true`, will take priority over any state in `hiddenColumns` and force this column to be visible at all times.
|
||||
- If set to `false` will take priority over any state in `hiddenColumns` and force this column to be hidden at all times.
|
||||
- `width: Int`
|
||||
- Optional
|
||||
- Defaults to `150`
|
||||
|
||||
Reference in New Issue
Block a user