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

table rowSelection问题 #2127

Closed
lifeneedspassion opened this issue Jun 21, 2016 · 5 comments
Closed

table rowSelection问题 #2127

lifeneedspassion opened this issue Jun 21, 2016 · 5 comments

Comments

@lifeneedspassion
Copy link

现在table要选中项必须添加rowSelection属性,之前版本rowSelection设为null是有用的,现在设为null会报错

主要考虑到如果表格没有数据,然而又需要显示一些自己的提示信息,把rowSelection设为{},checkbox依然会和提示信息一起渲染

@afc163
Copy link
Member

afc163 commented Jun 21, 2016

const tableProps = needRowSelection ? { rowSelection: { ... } } : null;
return <Table {...tableProps} />

这样如何?

@afc163
Copy link
Member

afc163 commented Jun 21, 2016

rowSelection 可以设为 null,我测试不会报错。最好给出重现。

@lifeneedspassion
Copy link
Author

http://codepen.io/lifeneedspassion/pen/LZbEYm?editors=001


null
变为
const rowSelection = { onChange: record => {}, selectedRowKeys: [] }
的时候会报错

@afc163 afc163 closed this as completed in 7d06517 Jun 21, 2016
@afc163
Copy link
Member

afc163 commented Jun 21, 2016

感谢帮忙重现。

@lock
Copy link

lock bot commented May 5, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants