当前位置:网站首页>antd table+checkbox 默认值显示
antd table+checkbox 默认值显示
2022-07-27 10:22:00 【会跳舞的小猴子】

在antd 官网我使用的是defaultSelectedRowKeys,页面对默认数值进行了反显
但是在我的代码中并不好使
我用了selectedRowKeys
<Table className='table-cy'
rowSelection={
{
type:"checkbox",
selectedRowKeys:arr,
defaultSelectedRowKeys:["1391713813278482433"],
...rowSelection,
}}
columns={
this.state.columnsTable}
dataSource={
userList}
scroll={
{
y: 292}}
rowKey='id'
pagination={
false}
selectedRows={
this.onChangeAll}
/>
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
this.state.selectedUsers = selectedRowKeys
this.state.selectedUserRow = selectedRows
console.log(selectedRowKeys, selectedRows)
this.setState({
arr:selectedRowKeys
})
},
getCheckboxProps: record => ({
defaultChecked: record.selected === 1, // 配置默认勾选的列
}),
};

即可反显
边栏推荐
- OpenAtom OpenHarmony分论坛,今天14:00见!附大事记精彩发布
- Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process
- Family Trivia
- Matlab- draw bifurcation and chaotic bifurcation diagrams
- Eslint的报错信息Module Error (from ./node_modules/[email protected]@eslint-loader/index.js)解决方法
- Apache22 and opencms9.5 integrated configuration
- Oracle 11g manual memory management
- The core concept and fast practice of shardingsphere
- Loop traversal of foreach and some of ES6
- Openldap custom schema
猜你喜欢

File upload vulnerability bypass method

搭建 Samba 服务

WebRTC实现简单音视频通话功能
![[Linux] mariadb/mysql scheduled full backup script and data recovery](/img/02/8ee01336a46e4956738f3cc8e30683.png)
[Linux] mariadb/mysql scheduled full backup script and data recovery

ctf (hardrce)

已解决SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated

One stop monitoring of the software and hardware infrastructure of the whole university, and Suzhou University replaces PostgreSQL with time series database

MySQL log management, backup and recovery

服务器访问速度

MySQL must know and know!!! Reading this article is enough!!!
随机推荐
Metaspolit
[brother hero's June training] day 26: check the collection
Redis数据结构分析(二)
[brother hero June training] day 25: tree array
The permission problem of Oracle operating openldap
[brother hero's June training] day 27: picture
Analysis of heterogeneous computing technology
ctf (hardrce)
Family Trivia
【Liunx】安装Redis
Samba server
MySQL数据表的高级操作
[Linux] mariadb/mysql scheduled full backup script and data recovery
Multipoint bidirectional republication and routing strategy
家庭琐事问题
MySQL 索引、事务与存储引擎
R语言管道符(%>%)及占位(.)的简单介绍
Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process
Beijing publicized the spot check of 8 batches of children's shoes, and qierte was listed as unqualified
warning package.json: No license field报错