Open Tss-16 opened 4 weeks ago
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
EditableProTable需要和表格外的数据进行联动,使用name="table"属性结合完成数据联动, 但是addEditRecord()方法新增子项失效,无法新增子项且会删除已存在子项,注释掉name="table"后新增子项就可以实现。
name="table"
` // 新增子项触发方法 <Button type="text" icon={} 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', }, ); }}
`
看不出来,给个sandbox或者贴最小化复现代码?
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
EditableProTable需要和表格外的数据进行联动,使用 完成数据联动,
但是addEditRecord()方法新增子项失效,无法新增子项且会删除已存在子项,注释掉
name="table"
属性结合name="table"
后新增子项就可以实现。📷 复现步骤
` // 新增子项触发方法 <Button type="text" icon={ }
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',
},
);
}}
© 版本信息
🚑 其他信息