imballinst / react-bs-datatable

Bootstrap datatable without jQuery. Features include: filter, sort, pagination, checkbox, and control customization.
https://imballinst.github.io/react-bs-datatable
MIT License
60 stars 20 forks source link

Remove Paging options and pagination form table #6

Closed Swarna-Jain closed 7 years ago

Swarna-Jain commented 7 years ago

Ho can I remove or hide pagination and paging options in data table?

imballinst commented 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?

Swarna-Jain commented 7 years ago

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.

imballinst commented 7 years ago

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?

Swarna-Jain commented 7 years ago

That's cool ...

imballinst commented 7 years ago

Okay, I'll work on it soon!

Swarna-Jain commented 7 years ago

Thanks

imballinst commented 7 years ago

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/

Swarna-Jain commented 7 years ago

It's exact what I want...

imballinst commented 7 years ago

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! :)