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) => { 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() {