AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.24k stars 783 forks source link

How to solve paging mismatch when inserting extended rows #2097

Closed ice-li closed 4 years ago

ice-li commented 4 years ago

When my project interface has a total of 83 pieces of data, and each piece of data has an extended row. For example, when pagination is 1, 13 pieces of data are returned, but the pagination button only displays a 1 button.

eg: { entrants: [ {id: 001, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 002, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 003, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 004, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 005, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 006, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 007, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 008, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 009, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 010, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 011, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 012, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]}, {id: 013, objects: [{attr:'001', value: '001'},{attr:'0011', value: '0011'}]} ], entry_count: 83 }

const options = {
  expandRowBgColor: 'rgb(242, 255, 163)',
  sizePerPageList: [ {
    text: '100', value: 100
  }],
  sizePerPage: 100,
  onPageChange: this.onPageChange.bind(this),
  paginationPosition: 'top',
  paginationShowsTotal: true,
  page: this.state.page
};

const fetchInfo = {
  dataTotalSize: this.props.entry_data.entry_count
}

Just like this, pagination only shows one button, but there are 7 pages in total