pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG]EditableProTable添加name属性无法新增子列?

Open Tss-16 opened this issue 10 months ago • 1 comments

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

EditableProTable需要和表格外的数据进行联动,使用name="table"属性结合<ProFormDependency/>完成数据联动, 但是addEditRecord()方法新增子项失效,无法新增子项且会删除已存在子项,注释掉name="table"后新增子项就可以实现。

📷 复现步骤

// 新增子项触发方法 <Button type="text" icon={<FormOutlined />} style={{ alignSelf: 'flex-end', }} onClick={() => { actionRef.current?.addEditRecord?.( { id: (Math.random() * 1000000).toFixed(0), title: '新的一行', parentKey: record.id, }, { newRecordType: 'dataSource', parentKey: record.id, recordKey: 'id', }, ); }} ></Button>

© 版本信息

  • "@ant-design/pro-components"版本: [2.4.4]
  • "@umijs/max": [4.0.66]
  • 浏览器环境[Chrome]
  • 开发环境 [windows]

🚑 其他信息

Tss-16 avatar Apr 17 '24 09:04 Tss-16

看不出来,给个sandbox或者贴最小化复现代码?

fnoopv avatar Apr 17 '24 09:04 fnoopv