mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-28 17:10:01 +00:00
onTrClick (#23)
* README: correct watch command * Add onTrClick handler * react soften peerDependency: ^15.x.x
This commit is contained in:
@@ -96,6 +96,7 @@ These are the default props for the main react component `<ReactTable />`
|
||||
|
||||
// Callbacks
|
||||
onChange: (state, instance) => null, // Anytime the internal state of the table changes, this will fire
|
||||
onTrClick: (row, event) => null, // Handler for row click events
|
||||
|
||||
// Text
|
||||
previousText: 'Previous',
|
||||
@@ -290,7 +291,7 @@ If you would like to help develop a suggested feature follow these steps:
|
||||
|
||||
- Fork this repo
|
||||
- `npm install`
|
||||
- `npm watch`
|
||||
- `npm run watch`
|
||||
- Implement your changes to files in the `src/` directory
|
||||
- Submit PR for review
|
||||
|
||||
@@ -300,7 +301,7 @@ If you would like to preview your changes, you can link and utilize the example
|
||||
- `cd example`
|
||||
- `npm install`
|
||||
- `npm link react-table`
|
||||
- `npm watch`
|
||||
- `npm run watch`
|
||||
- Make changes to the example in `src/screens/index.js` if needed
|
||||
- View changes at `localhost:8000`
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"classnames": "^2.2.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^15.3.1"
|
||||
"react": "^15.x.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "6.14.0",
|
||||
|
||||
@@ -23,6 +23,7 @@ export const ReactTableDefaults = {
|
||||
tbodyClassName: '',
|
||||
trClassName: '',
|
||||
trClassCallback: d => null,
|
||||
onTrClick: () => null,
|
||||
thClassName: '',
|
||||
thGroupClassName: '',
|
||||
tdClassName: '',
|
||||
@@ -358,6 +359,7 @@ export default React.createClass({
|
||||
return (
|
||||
<TrComponent
|
||||
key={i}
|
||||
onClick={event => this.props.onTrClick(rowInfo.row, event)}
|
||||
className={classnames(this.props.trClassName, this.props.trClassCallback(rowInfo))}
|
||||
style={Object.assign({}, this.props.trStyle, this.props.trStyleCallback(rowInfo))}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user