任何人都可以帮助我们如何实现表格页脚以显示列总数。有什么方法可以呈现自定义表格页脚吗?正如我检查的那样,没有任何方法可以覆盖或附加自定义表格页脚。
import React from 'react';
import { XGrid, useGridApiRef } from '@material-ui/x-grid';
const MaterialDataTable = (props) => {
const renderData = () => {
if (props.data?.length) {
return props.data.map(item => {
return {...item, id: item.postid}
})
} else {
return []
}
}
return (
<div className="customTable" style={{ height: 1440, width: '100%' }}>
<XGrid
rows={renderData()}
columns={props.columns}
autoHeight
pageSize={10}
rowsPerPageOptions={[10, 20, 50]}
loading={props.loading}
getRowId={(row) => row.postid}
onRowClick={(record) => {
props.rowClick(record.row, record.rowIndex)
}}
rowHeight={132}
pagination={true}
components={
{
}
}
disableClickEventBubbling
/>
</div>
);
}
export default MaterialDataTable;