Closed kala2 closed 5 years ago
This feature/issue has been tagged as one that will likely be fixed or improved in the next major release of React-Table. This release is expected to be completed in the next 6 - 8 months. Please see #1143 for more detail. If you believe this feature can be easily fixed, we invite you to fork the project, attempt the fix, and use it until the latest version is available. If the fix is simple enough, we will also consider it as a PR to the current version.
Is this issue solved?
I'm bumping into the same issue, is there a way to selectively disable things? I just want API pagination but keep the sorting like the OP
Having the same issue. Please keep us updated!
Hello! Any news about this?
Has anyone found a workaround for this issue?
Hi I have applied all the manual pagination but the filtering is not working :( I wish I knew this before implementing it.
I had a similar problem (using version 6.8.5
).
You need to set onFetchData
option as well. It is called both on changing the page and on sorting/filtering.
Overall, my simplified component looks like this:
const TableViewComponent = (
props
) => {
// some other logic ....
return (
<div className={classes.container}>
<ReactTable
loading={isLoading}
columns={columns}
manual
data={dataToRender}
pages={pagesCount}
pageSizeOptions={pageSizeOptions}
pageSize={recordsPerPage}
onPageSizeChange={pageSize => {
setPageNumber(0);
setRecordsPerPage(pageSize);
getNewData({
rowLimit: pageSize,
rowOffset: firstRecordOffset.current,
});
}}
page={pageNumber}
filterable
filtered={tableFiltered}
onFilteredChange={filtered => setTableFiltered(filtered)}
sorted={tableSorted}
onSortedChange={sorted => setTableSorted(sorted)}
defaultFiltered={[]}
onFetchData={state => {
const newData = fetchData(
data,
state.pageSize,
state.page,
state.sorted,
state.filtered,
);
setDataToRender(newData);
}}
onPageChange={pageIndex => {
setPageNumber(pageIndex);
getNewData({
rowLimit,
rowOffset: pageIndex * rowLimit + firstRecordOffset.current,
});
}}
defaultPageSize={rowLimit}
multiSort={false}
className={`-striped -highlight ${classes.table}`}
/>
</div>
);
};
could we add manual pagination option to sperate pagination way from sorting and filtering which make sense
I have a table which displays clinics. I have also a onPageChange prop which handles the pageIndex and then i fetch the data based on that page. Below is my table configuration
Notice that i have disabled manual prop. If i enable the manual prop then i can navigate through next and previous pages but i cannot sort or filter the data.
With the manual prop disabled the filtering and the sorting works correct but when i navigate in the next page the table in this particular page is showed empty. The first page displays correct the first 10 data. Also i have tested the api and returns correct the next 10 data.
Also the devs.paginationData.pageNumber is updated correctly, and the page is changing with the correctly page number on the table
Is there any workaround? To keep both server side pagination and also the default sorting and filtering?