ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.04k stars 1.29k forks source link

👑 [需求] ProTable 控制是否展示全选框列 #8350

Closed a1392136 closed 2 weeks ago

a1392136 commented 2 weeks ago

🔩 所属模块或组件

ProTable

🥰 需求描述

希望添加全选框列是否展示的属性

⛰ 功能需求适用场景

默认表单不展示全选框列,当用户点击编辑按钮时展示全选框列

🧐 解决方案

是否可以在 rowSelection 中添加 hideSelectAllColumn 属性,通过该属性控制是否展示全选框列

🚑 其他信息

目前虽然可以通过 rowSelection 中的 hideSelectAll 属性隐藏表头的复选框,并结合 rowSelection 中 renderCell 通过以下代码做到隐藏。

renderCell: (r, _, originNode) => {
          if (selection) {
            return originNode;
          }
          return null;
        }

下图是上述方案的效果 image

github-actions[bot] commented 2 weeks ago

当前 Issue 未检测到标题,请规范填写,谢谢!

The title of the current issue is not detected, please fill in according to the specifications, thank you!

github-actions[bot] commented 2 weeks ago

当前 Issue 未检测到标题,请规范填写,谢谢!

The title of the current issue is not detected, please fill in according to the specifications, thank you!