Open crudnick opened 4 years ago
https://github.com/gregnb/mui-datatables#options
const options = { page: 0, ...otherOptions, };
+1
Unfortunately this doesn’t work for me. I tried that option already (as written above) Since I’m updating the result set from outside, it is a different use case. Here it stays on the page I have been before.
On 9. February 2020 at 07:32:05, Woo Dohyeong (notifications@github.com) wrote:
https://github.com/gregnb/mui-datatables#options
const options = { page: 0, ...otherOptions, };
i think... try Use the status (page)
const [myPage, setMyPage] = useState(0);
const options = { page: myPage, ...otherOptions, };
I've faced with same behavior, options doesn't update after table has been initialized. So I change key for table for evey new response received from server.
<MUIDataTable
key={`table_${pagination.currentPage}`}
options={ page: pagination.currentPage - 1 }
/>
I'm using the data tables with server side filtering, to be able to adapt the result set. When i go through the pages (client side pagination is enabled) and decide to tweak my server side search and get a new result set, the datatable stays on the page number i viewed before.
Expected Behavior
The datatable should start with page 0 when it gets a new result set. (i set the option page=0 already)
Your Environment