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

Using pagination without a table #8520

Closed
joonarahko opened this issue Oct 3, 2017 · 5 comments
Closed

Using pagination without a table #8520

joonarahko opened this issue Oct 3, 2017 · 5 comments
Labels
component: table This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@joonarahko
Copy link

joonarahko commented Oct 3, 2017

Right now the pagination works well for paginating tables. However, I have a use case where I want to paginate an unordered list. Right now I can override the root tr component to be a div for example. However, I would like to be able to turn the underlying td into something else as well. Overall I think it would be good if I could use the pagination outside of a table.

@oliviertassinari oliviertassinari added component: table This is the name of the generic UI component, not the React module! v1 new feature New feature or request labels Oct 3, 2017
@oliviertassinari
Copy link
Member

@leMaik I have been having a look at how react-toolbox is going to handle deep nesting of the components. This is something we could explore but I believe we could implement something simpler.
Here is what I propose: we remove the TableRow from the TablePagination component. It should be straightforward. Then the root components become a TableCell. As far as I know, people can customize it to fit anywhere.

@leMaik
Copy link
Member

leMaik commented Oct 3, 2017

@oliviertassinari As long as the pagination component still looks as in the specs when used in a table, I'm finde with that. 👍 Sounds like one would just need to wrap <TablePaginaten ... /> inside <TableRow> when using it inside a table? Is using a TableCell outside of a table ok?

Edit: Oh nice, TableCell has a component prop. 🎉 I'm working on a PR...

@joonarahko
Copy link
Author

🎆 🍾 🎉

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 4, 2017

Here is how to use the TablePagination outside of the table with #8525:

<TablePagination component="div" 

@cherendeen-envative
Copy link

cherendeen-envative commented Jun 13, 2022

Edit: After further investigation, I discovered that in the current source the TablePagination component uses the "div" component prop by default. Unfortunately this doesn't appear to be in the latest 5.8.3 though. So im stuck waiting for a new release, or im miss interpreting something.

From TablePagination.js in 5.83
Its still using a td instead of a div by default and with no way to override.

const {
    ActionsComponent = TablePaginationActions,
    backIconButtonProps,
    className,
    colSpan: colSpanProp,
    component = TableCell,
    ...
  } = props,
...

Unfortunately this is no longer possible due to the component now being omitted from the base props:

export type TablePaginationBaseProps = Omit<TableCellProps, 'classes' | 'component' | 'children'>;

Trying to find another way. I need to be able to place the pagination controls in the table header ( but above the header columns )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants