STh*_*Tha 7 pagination material-table
自定义分页的任何示例?材料表和reactjs。我想将页面大小传递给服务器,并且需要隐藏分页中的第一个和最后一个按钮
Ore*_*tes 17
Styudy 这个例子https://material-table.com/#/docs/features/component-overriding为了更好地理解我将展示的代码:有了这个,你可以直接访问分页组件并自己进行调用.
`components={{
Pagination: props => (
<TablePagination
{...props}
rowsPerPageOptions={[5, 10, 20, 30]}
rowsPerPage={this.state.numberRowPerPage}
count={this.state.totalRow}
page={
firstLoad
? this.state.pageNumber
: this.state.pageNumber - 1
}
onChangePage={(e, page) =>
this.handleChangePage(page + 1)
}
onChangeRowsPerPage={event => {
props.onChangeRowsPerPage(event);
this.handleChangeRowPerPage(event.target.value);
}}
/>
),
}}`
Run Code Online (Sandbox Code Playgroud)
使用相同的方式可以更改此按钮的文本,请查看此示例https://material-table.com/#/docs/features/localization。
此致