Double click on table row

Hi,

Is there a way to invoke an event/action when a row of a data table is double clicked? Basically I need to update the content (bring details) when user double clicks the row (rather than select a row). Any ideas? :slight_smile:

Thanks in advance

You should be able to do that with a “Custom Script” control.

Set the “For” property to the id of the table control.
Set “Event” property to “ondblclick”

Set the “Code” property to something like this:


var clickedOn = event.srcElement;

//walk up the DOM to find the row element containing the element that was clicked on
var parent = $(clickedOn);
while (parent != null && parent.tagName != "TR") {
        parent = parent.parentNode;
}
if (parent) {
    //make sure the row was not in the table header or footer.
	if (parent.parentNode.tagName == "TBODY") {	
   		var rowId = parent.id;
   		alert("DblClicked on row: " + rowId);
   		//TODO: do something with the clicked row here.
 	}
}

Great thanks for answer. That’s works just fine :slight_smile: