Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(table): clean up stories #2430

Merged
merged 4 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
501 changes: 71 additions & 430 deletions packages/react/src/components/Table/StatefulTable.story.jsx

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions packages/react/src/components/Table/Table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ Advanced filtering is experimental and may be subject to change, so it's usage i
## Pagination

Pagination is controlled through the `options.hasPagingation` prop combined with the `view.pagination` prop. Pagination has one callback event for onChangePage that is fired when the page or the number of items per page changes.
By default, tables with pagination will expect the entire table data to be passed in on the `data` prop; the visible data for a page is calculated dynamically by the table based on the page size and page number. In the case where the table is rendering a large data set, the `options.hasOnlyPageData` prop can be used change this behavior. With `options.hasOnlyPageData = true`, the `data` prop will be expected to contain only the rows for the visible page.

```jsx
<Table
Expand All @@ -697,6 +698,28 @@ Pagination is controlled through the `options.hasPagingation` prop combined with
/>
```

```jsx
<Table
actions={{
pagination: {
onChangePage: ({ page, pageSize }) => {},
},
}}
options={{
hasPagination: true,
hasOnlyPageData: true,
}}
view={{
pagination: {
pageSize: 10,
pageSizes: [10, 20, 30],
page: 8267,
totalItems: 97532,
},
}}
/>
```

## Batch actions

You can combine batch actions with the `Table` component to allow the user
Expand Down
Loading