salary-management-front/pc4mobx/hrmSalary/components/customPaginationTable/index.js

35 lines
1014 B
JavaScript

import React, { PureComponent } from "react";
import CustomTable from "../../components/customTable";
class CustomPaginationTable extends PureComponent {
shouldComponentUpdate(nextProps, nextState, nextContext) {
return !(nextProps.columnIndex && this.props.columnIndex !== nextProps.columnIndex);
}
render() {
return (
<CustomTable
{...this.props}
pagination={{
onChange: value => {
this.props.onPageChange(value);
},
total: this.props.total,
showTotal: total => `${total}`,
current: this.props.current,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
showQuickJumper: true,
pageSize: this.props.pageSize,
onShowSizeChange: (current, pageSize) => {
this.props.onShowSizeChange &&
this.props.onShowSizeChange(current, pageSize);
}
}}
/>
);
}
}
export default CustomPaginationTable;