Closed Swarna-Jain closed 7 years ago
I actually set it in the defaultProps
.
Datatable.defaultProps = {
tableClass: '',
rowsPerPage: 5,
rowsPerPageOption: [5, 10, 15, 20],
initialSort: undefined,
};
Yeah, I think you're right, I should have made a way for people who want their whole data appear without pagination. I think it this way: we need to pass undefined
to rowsPerPage
and rowsPerPageOption
to disable the table pagination. What do you think?
If it is being done at the time of implementation (rowsPerPage ={undefined} & rowsPerPageOption={undefined} Datatable assumes default.. I actually want to hide both of the options from Data table display rather than disable only... if it is possible to put control over visibility. like .. pagination = "disabled" or pagination = {false} and pagination will be disappeared. as well as rowsPerPageOption and rowsPerPage options will become undefined or null.
Um, I mean, I set them (defaultProps.rowsPerPage
and defaultProps.rowsPerPageOption
) to undefined
too. I think it's cleaner than adding a new prop, because if someone doesn't define rowsPerPage
and rowsPerPageOption
props, that means he/she doesn't want to use the pagination, isn't it?
That's cool ...
Okay, I'll work on it soon!
Thanks
Hi, kindly check my PR: https://github.com/Imballinst/react-bs-datatable/pull/7 If you want to test it live: https://imballinst.github.io/react-bs-datatable/beta/1.1.12/
It's exact what I want...
Alright, I'll merge the branch and I'll publish it to NPM after, should you have any more suggestions/issues, feel free to file another issue! :)
Ho can I remove or hide pagination and paging options in data table?