最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to remove select all checkbox in mui data grid header - Stack Overflow

programmeradmin3浏览0评论

I want to remove the Select All checkbox which is at the top of the checkbox datacolumn.

checkboxSelection

adds checkboxes for every row but also adds the select all checkbox on top in the header. How can i remove this?

I want to remove the Select All checkbox which is at the top of the checkbox datacolumn.

checkboxSelection

adds checkboxes for every row but also adds the select all checkbox on top in the header. How can i remove this?

Share Improve this question asked Sep 13, 2022 at 9:40 akshay_acharyaakshay_acharya 892 silver badges11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

I had the same problem and was looking at the MUI-X git. I found a solution for this, is hide the header of the checkbox, so in that way you will remove the select all behavior.

Hope this works for you as well.

Here is the original solution on git: https://github./mui/mui-x/issues/1904#issuement-1219293315

<DataGrid
...
sx={{
  "& .MuiDataGrid-columnHeaderCheckbox .MuiDataGrid-columnHeaderTitleContainer": {
    display: "none"
  }
}}/>

Example

发布评论

评论列表(0)

  1. 暂无评论