Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG]在EditableProTable中添加子项,子项可以添加成功 不过添加的子项不能继续添加子项 parentKey不生效 #5566

Closed
JILL1231 opened this issue Jul 18, 2022 · 2 comments

Comments

@JILL1231
Copy link

提问前先看看:

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

🐛 bug 描述

子项无法添加孩子节点,parentKey不生效

📷 复现步骤

希望实现添加子项的功能,子项可以添加子项的子项 不过添加的子项不能继续添加子项 parentKey不生效。

刚刚接触EditableProTable,希望实现点击添加子项。但是无论是action?.addEditRecord还是EditableProTable.RecordCreator其中的parentKey都不生效,添加子项过后 添加的子项不能自己添加子项

🏞 期望结果

在行后有“添加子项”按钮,点击后在该项下创建一个新的子项 新的子项可以继续添加子项

💻 复现代码

#4246

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

#4246
此问题并没有解决,依旧存在

@jayt1001
Copy link

遇到了同样的问题

@smartranger
Copy link

给ProTable设置expandable={{childrenColumnName: 'children'}}即可修复。即使没有改变默认的'children'字段也要手动设置这个属性。
发现这个解决方法是看了addEditRecord的实现,通过parentKey查找dataSourceKeyIndexMapRef。而dataSourceKeyIndexMapRef是写了遍历'childrenColumnName'字段的代码的。这个地方需要进一步Fix。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants