How to detect a row double click?

How to detect a row double click?

kolbankolban Posts: 5Questions: 2Answers: 0

I have a desire to display a table of data and perform an action when a user double clicks upon a row. Is there a recipe or technique that can be used to detect a double click event on a row and determine upon which row the action was performed?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin
    Answer ✓

    I would suggest you use a jQuery event handler for the dblclick event. This example shows a standard single click.

    Allan

  • Johnathan501Johnathan501 Posts: 2Questions: 1Answers: 1
    Answer ✓

    So basically replace 'click' in the example Allan linked with 'dblclick' as shown bellow.

    $('#example tbody').on('dblclick', 'tr', function () {
    var data = table.row( this ).data();
    alert( 'You clicked on '+data[0]+'\'s row' );
    } );

  • kolbankolban Posts: 5Questions: 2Answers: 0

    Thank you allan and Jonathan501. That is exactly what I was looking for. Thank you again SO much.

This discussion has been closed.