material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Changing the rowsPerPage doesn't display all of the rows if the number is higher than the amount of rows it starts with

Open roseak opened this issue 6 years ago • 6 comments

Describe the bug If the first data you load into the table has x number of rows per page, you can change the rows per page to be amounts that are smaller or equal to x, but you can't do higher.

To Reproduce Steps to reproduce the behavior: Have the default pageSize set to 100 with server side pagination. If you change the rows per page to be 25 or 50, it'll change and show the correct amount. If you click on 200, even if the prop data now has 200 items, it still will only show the first 100. Not sure what's happening to the rest of the items, since the data being passed into the prop is correct and the pageSize and rowsPerPage and page are all correct.

roseak avatar Apr 08 '20 01:04 roseak

I have updated from 1.39.0 to 1.57.2, and now facing the same issue.

telperion357 avatar Apr 11 '20 01:04 telperion357

Is there any update about this issue?

fabiiomariiano avatar May 25 '20 11:05 fabiiomariiano

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Aug 23 '20 12:08 stale[bot]

I am facing exactly same issue. Any updates on this?

madhuraadawadkar avatar Dec 08 '20 18:12 madhuraadawadkar

I am having this issue too with remote data. Any work around?

itusuarez avatar Feb 18 '21 15:02 itusuarez

This was my work around:

<MaterialTable
                tableRef={tableRef}
                columns={columns}
                data={data}
                options={{
                    showTitle: false,
                    headerStyle: {
                        fontWeight: "bolder"
                    },
                    pageSizeOptions: rowsPerPage,
                    pageSize: pageSize,
                    emptyRowsWhenPaging: false
                }}
                components={{
                    Toolbar: () => null,
                    Pagination: (props) => (
                        <TablePagination
                            {...props}
                            onChangeRowsPerPage={(event: React.ChangeEvent<HTMLInputElement>) => {
                                props.onChangeRowsPerPage(event);
                                setPageSize(parseInt(event.target.value, 10));
                            }}
                        />
                    ),
                }}
            />

itusuarez avatar Feb 18 '21 15:02 itusuarez