From fb1f9b646c44b7330d2d462627cf107603b987dc Mon Sep 17 00:00:00 2001 From: Josh Ouyang Date: Fri, 19 Aug 2016 11:13:29 +0800 Subject: [PATCH 1/2] Add original event param for onRowClick property --- src/TableRow.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TableRow.jsx b/src/TableRow.jsx index 632946d43..8c596e762 100644 --- a/src/TableRow.jsx +++ b/src/TableRow.jsx @@ -45,7 +45,7 @@ const TableRow = React.createClass({ this.props.onDestroy(this.props.record); }, - onRowClick() { + onRowClick(event) { const { record, index, @@ -59,7 +59,7 @@ const TableRow = React.createClass({ if (expandable && expandRowByClick) { onExpand(!expanded, record); } - onRowClick(record, index); + onRowClick(record, index, event); }, onMouseEnter() { From e6dcf2318a9306e273828032eb31ed388e33460c Mon Sep 17 00:00:00 2001 From: Josh Ouyang Date: Fri, 19 Aug 2016 11:27:25 +0800 Subject: [PATCH 2/2] Add example. --- examples/rowClick.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/rowClick.js b/examples/rowClick.js index 9755d1caf..c2e060150 100644 --- a/examples/rowClick.js +++ b/examples/rowClick.js @@ -4,8 +4,12 @@ const ReactDOM = require('react-dom'); const Table = require('rc-table'); require('rc-table/assets/index.less'); -const onRowClick = (record, index) => { +const onRowClick = (record, index, event) => { console.log(`click nth(${index}) element of parent, record.name: ${record.name}`); + // See https://facebook.github.io/react/docs/events.html for original click event details. + if (event.shiftKey) { + console.log('Shift + mouse click triggered.'); + } }; const onOperationClick = (text, record) => {