react-data-grid
react-data-grid copied to clipboard
dblClick row dblClick event
How can I add a double-click event on a row?
hey @mohak1990,
you can do this using a Custom Row Renderer (see http://adazzle.github.io/react-data-grid/examples.html#/custom-row-renderer)
your component would be something like:
var RowRenderer = React.createClass({
PropTypes: {
onDoubleClick: React.PropTypes.func
},
render: function() {
return (<ReactDataGrid.Row ref="row" {...this.props} onDoubleClick={this.props.onDoubleClick} /></div>)
}
});
function onDoubleClick(e) {
// handle click event here
}
var Example = React.createClass({
render: function() {
return (<ReactDataGrid
columns={columns}
rowGetter={rowGetter}
rowsCount={_rows.length}
minHeight={500}
rowRenderer={<RowRenderer onDoubleClick={this.onDoubleClick} />} />);
}
});
This doesn't work.
@jpdriver this does not work. Should I add this as another porp to React Data Grid and handle it ?
I think this is happening because we do event.stopPropogation in the click handlers on cell.