-
Notifications
You must be signed in to change notification settings - Fork 445
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
DBTable配置成Tree Table自动展开属性不起作用。 #40
Comments
我试了下貌似是可以,直接改的InnerTable.js,代码类似这样:
是不是defaultExpandAllRows的数据类型不对?如果写成 |
做test的时候,加过好像没起作用。新作一个页面,同样代码又是可以的。不知道DBTable里面有什么特殊操作吗?
1935326097@qq.com
发件人: ywzhaiqi
发送时间: 2017-06-24 13:38
收件人: jiangxy/react-antd-admin
抄送: whyuan1976; Author
主题: Re: [jiangxy/react-antd-admin] DBTable配置成Tree Table自动展开属性不起作用。 (#40)
InnerTable.js 里的 defaultExpandAllRows 加了?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
传递给 table 的 dataSource 的数据是筛选过的(结构如下),默认没有了 children
可修改
|
你怎么加载远程数据的? |
树形结构的table(例如组织关系)是不需要2次加载的,这时希望能使用defaultExpandAllRows 全展开。按照指定key的方式,是可以展开的,就是太麻烦了。二次加载的table也做过,加载的数据需要按照展开的key做map保存。我偷懒展开一个就自动关闭其他的,只需要保存最新展开的data。 |
@whyuan1976 |
二次加载是在onExpand里实现,二次加载这部分没问题。是一次性加载树形结构的数据,无法通过defaultExpandAllRows 属性默认展开所有节点。 |
原来是 你的这个问题是 antd table 自身的问题。你的示例改成 componentDidMount 加载数据,默认就不会展开了。 |
@ywzhaiqi |
defaultExpandAllRows 不起作用。手工可以点开。试了一下,底层应该是可以的。
类似如下:
https://codepen.io/anon/pen/OgmVmR?editors=001
The text was updated successfully, but these errors were encountered: