gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.71k stars 932 forks source link

In pagination on select rows per page if row count is less than rows per page,page goes blank #356

Closed avanish19 closed 5 years ago

avanish19 commented 5 years ago

In table lets say have I have 12 data. Then by selecting rows per page 10 , it will show '1-10 of 12' and after click on next page then in pagination, it shows "11-12 of 12". At this point, if I select rows per page 15 or 100, then the whole page goes blank. In console it shows error : "main.29422859.chunk.js:390 Error: Provided options.page of 1 is greater than the total available page length of 0 at t.value (main.29422859.chunk.js:59) at t.value (main.29422859.chunk.js:59) at m (main.29422859.chunk.js:390) at beginWork (main.29422859.chunk.js:390) at r (main.29422859.chunk.js:390) at i (main.29422859.chunk.js:390) at A (main.29422859.chunk.js:390) at _ (main.29422859.chunk.js:390) at v (main.29422859.chunk.js:390) at interactiveUpdates (main.29422859.chunk.js:390) a @ main.29422859.chunk.js:390 11:52:56.698 main.29422859.chunk.js:390 Uncaught Error: Provided options.page of 1 is greater than the total available page length of 0 at t.value (main.29422859.chunk.js:59) at t.value (main.29422859.chunk.js:59) at m (main.29422859.chunk.js:390) at beginWork (main.29422859.chunk.js:390) at r (main.29422859.chunk.js:390) at i (main.29422859.chunk.js:390) at A (main.29422859.chunk.js:390) at (main.29422859.chunk.js:390) at v (main.29422859.chunk.js:390) at interactiveUpdates (main.29422859.chunk.js:390)"

Please refer sanpshot.

Expected Behavior

Current Behavior

Steps to Reproduce (for bugs)

1.Create a table having more than 10 data. Lets say 12 data. 2.Then by selecting rows per page 10 , it will show '1-10 of 12'

  1. Click on next page then in pagination, it shows "11-12 of 12". At this point, if I select rows per page 15 or 100, then the whole page goes blank.

Your Environment

Tech Version
Material-UI ^1.0.0-beta.47
MUI-datatables ^1.1.7
Reactify @V2
browser chrome
etc

table1 table2 pagination issue

gregnb commented 5 years ago

Try upgrading to the latest version which is -50

avanish19 commented 5 years ago

@gregnb Thank you