Skip to content

Conversation

jaredleechn
Copy link
Member

使用方法:

const onRowClick = function(record, index){}

<Table onRowClick={onRowClick} />
  1. this 指向 <TableRow />
  2. index 代表在 father.children 里面的 index,不是在所有 rowindex

fix ant-design/ant-design#355
fix ant-design/ant-design#767

src/TableRow.jsx Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用绑定 this 。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed @afc163

afc163 added a commit that referenced this pull request Jan 8, 2016
@afc163 afc163 merged commit a24546c into master Jan 8, 2016
@afc163 afc163 deleted the onRowClick branch January 8, 2016 02:34
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

Successfully merging this pull request may close these issues.

如何通过点击事件获得table的某行记录 Table: 如何添加 TableRow 的 onClick 事件
2 participants