TotalCount of Records for pagination cannot be specified in any props
Describe the bug Need to set count for pagination which does pagination from server side. Since I am not able to set the count of total records pagination function is not working as it takes pagesize as the count.
components={{ Pagination: props => ( <TablePagination rowsPerPageOptions={[5, 10, 25]} colSpan={3} count={rows.length} rowsPerPage={rowsPerPage} page={page} SelectProps={{ native: true, }} onChangePage={this.handleChangePage} onChangeRowsPerPage={this.handleChangeRowsPerPage} ActionsComponent={TablePaginationActionsWrapped} /> ), }} onChangeRowsPerPage = {this.handleChangeRowsPerPage} onChangePage = {this.handleChangePage}
The last two lines become waste as I have to provide it as input to the custom pagination component again
Can count alone be set without touching other pros
This is very urgent, can this be added to any release soon?
Actually i am very busy with other features and my other projects. So this will take time. Also i am planning to implement fully server side feature that includes paging, filtering, search, sorting and so on.
for now if this count alone can be given global access, it will be great. Since you will not be able to work on that. Any planned deadlines for finishing serer side feature?
Actually there is no planned deadline. But it could be in 2 months. Because before server side feature i want o complete minor requirements and refactor code to be stay clean.
in that case would it be possible to add count in global props for now.
components={{ Pagination: props => ( <TablePagination {...props} /> ), }}
This is the example give in material for custom pagination component, is there a way to set/update count for the props.
I am new to React js so, could you let me know if there is a way through which I can set the count, can you give some sample code to do this
- Copy this code to your project and rename the component: https://github.com/mbrn/material-table/blob/master/src/m-table-pagination.js
- Change what you need.
- Override the Pagination component with components property of material-table.