3

I'm using blueprintjs's table to populate data and want some method to be called on double-clicking the table row. Is there any way to achieve it?

Thanks

1
  • There is no such thing as double click event. What you could do is create a variable which calls a function when the same button is pressed twice
    – Sagar
    May 10, 2017 at 12:14

3 Answers 3

4

I achieved this by setting interactive={true} on the Cell and then wrapping the cell contents in a div with the double click event:

<Cell
  interactive={true}
>
  <div onDoubleClick={this.handleDoubleClick}>{...}</div>
</Cell>
1
  • You must pay attention and use a div element. Using a span won't work as expected, because it won't fill the cell.
    – nagylzs
    Jun 30, 2019 at 7:52
0

you can additionally bind double click event on row. in javascript: use syntax

<p ondblclick="myFunction()">Double-click me</p>

in jquery:

$(row).on('dblclick', function() {
});
2
  • This happens in the DOM though. I think the question was about how this is done specifically with the blueprint table component.
    – user377628
    May 31, 2017 at 19:16
  • i just suggest a way of doing it through javascript or jquery. Jun 1, 2017 at 4:12
0
  1. there is indeed a browser "dblclick" event

  2. the Table does not currently support this. follow along at https://github.com/palantir/blueprint/issues/1087

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.