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

anurodh sahu
  • 123
  • 1
  • 6
  • 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 '17 at 12:14

3 Answers3

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>
Ben Rudolph
  • 2,509
  • 2
  • 19
  • 26
  • 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 '19 at 07: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() {
});
sumit chauhan
  • 1,270
  • 1
  • 13
  • 18
  • This happens in the DOM though. I think the question was about how this is done specifically with the blueprint table component. –  May 31 '17 at 19:16
  • i just suggest a way of doing it through javascript or jquery. – sumit chauhan Jun 01 '17 at 04: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

Gilad Gray
  • 451
  • 2
  • 6