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

How to bring pagination controls after the last record

Open vijthang61 opened this issue 7 years ago • 4 comments

paginationcss

How to resolve this issue

vijthang61 avatar Jan 30 '19 18:01 vijthang61

You should override the pagination component with your owns.

How to do this:

  1. Copy this code to your project and rename the component: https://github.com/mbrn/material-table/blob/master/src/m-table-pagination.js
  2. Change what you need.
  3. Override the Pagination component with components property of material-table.

mbrn avatar Jan 30 '19 18:01 mbrn

The problem what I see is that, the moment we change the number of records to display/pagesize, what happens is there are empty records which get displayed.

Lets say I set the pagesize as 50 initially, I change it to 10, what happens empty tr tags are getting created for the remaining 40 records.

Viceversa, if I set inital page size to 10 and change the pagesize to 50, it doesnt display all 50 records, but only

image

image

vijthang61 avatar Feb 06 '19 06:02 vijthang61

You can add emptyRowsWhenPaging: false in options

mbrn avatar Feb 06 '19 06:02 mbrn

thanks that resolved the problem

vijthang61 avatar Feb 06 '19 06:02 vijthang61