在reactjs材料表中,当垂直滚动时,动作图标和选择框正在浏览标头,重叠了标头
我在ReactJS项目中使用材料表。当我垂直滚动时,动作图标和选择框正在浏览标题。实际上,它是重叠的标题,滚动栏是从桌子的顶部开始的,但是我从标头的下面开始。
<MaterialTable
tableRef={tableRef}
title=""
onSelectionChange={(rows) => {
handleClick(rows);
}}
columns={headerData}
data={leadsDetails.data}
actions={[
{
icon: () => <PeopleAltIcon style={{ fontSize:"large", color: "#0096A2" }}/>,
tooltip: 'Assign',
position: 'row',
onClick: (event, rowData) => {
}
},
{
icon: () => <DeleteIcon style={{ fontSize:"large", color: "#0096A2" }}/>,
tooltip: 'Delete',
position: 'row',
onClick: (event, rowData) => {
setConfirmDialog({
isOpen:true,
title:"Are you sure to delete this record ?",
subTitle:"",
onConfirm:() =>{onDeleteIcon(event, rowData)}
})
}
},
]}
options={{
sorting: {sorting}, search: true,
paging: true, pageSizeOptions: [10,20,30], pageSize: 10,
exportButton: true,
//grouping: true, columnsButton: true,
headerStyle: { background: "#0096A2", color: "#fff", fontSize: "0.85rem", position:'sticky', top:0, whiteSpace:"nowrap", height: 20, maxHeight:20 },
rowStyle: { color: "#0096A2", fontSize: "0.8rem", padding: 0,height: 20, whiteSpace:"nowrap", maxHeight:20},
showTitle: false,
toolbar: false,
selection: true,
maxBodyHeight: '60vh',
draggable: false,
thirdSortClick: false
// tableLayout: "auto"
}}
isLoading={isLoading}
/>
I am using material-table in reactjs project. when I'm scrolling vertically, action icons and selection box are going through the header. actually it is overlapping the header and the scrollbar is starting from the top of the table, but i wwant to it to start from the below of the header.
<MaterialTable
tableRef={tableRef}
title=""
onSelectionChange={(rows) => {
handleClick(rows);
}}
columns={headerData}
data={leadsDetails.data}
actions={[
{
icon: () => <PeopleAltIcon style={{ fontSize:"large", color: "#0096A2" }}/>,
tooltip: 'Assign',
position: 'row',
onClick: (event, rowData) => {
}
},
{
icon: () => <DeleteIcon style={{ fontSize:"large", color: "#0096A2" }}/>,
tooltip: 'Delete',
position: 'row',
onClick: (event, rowData) => {
setConfirmDialog({
isOpen:true,
title:"Are you sure to delete this record ?",
subTitle:"",
onConfirm:() =>{onDeleteIcon(event, rowData)}
})
}
},
]}
options={{
sorting: {sorting}, search: true,
paging: true, pageSizeOptions: [10,20,30], pageSize: 10,
exportButton: true,
//grouping: true, columnsButton: true,
headerStyle: { background: "#0096A2", color: "#fff", fontSize: "0.85rem", position:'sticky', top:0, whiteSpace:"nowrap", height: 20, maxHeight:20 },
rowStyle: { color: "#0096A2", fontSize: "0.8rem", padding: 0,height: 20, whiteSpace:"nowrap", maxHeight:20},
showTitle: false,
toolbar: false,
selection: true,
maxBodyHeight: '60vh',
draggable: false,
thirdSortClick: false
// tableLayout: "auto"
}}
isLoading={isLoading}
/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论