This example demonstrates how to specify a function to be executed when a data grid cell is double clicked. This event is called onDataCellDblClick. Once the event is activated, the function that will be executed for this event will receive 4 parameters: row id, column id, record id and field reference.
Syntax: myGrid.onDataCellDblClick = function myFunction(row, recordid);
In this example, a function named onCellDblClick is assigned to the onDataCellDblClick event. When a row is double clicked, an alert dialog will appear with the row information..
function onCellDblClick (row, column, recordId, fieldReference){
var info1 = 'Row: ' + row + '\n';
var info2 = 'Column: ' + column + '\n';
var info3 = 'Record ID: ' + recordId + '\n';
var info4 = 'Field Alias: ' + fieldReference.fieldalias + '\n';
var info5 = 'Field ID: ' + fieldReference.fieldid + '\n';
var info6 = 'Field Type: ' + fieldReference.fieldtype + '\n';
var info7 = 'Is Field Searchable: ' + fieldReference.fieldsearchable + '\n';
alert('Information about the cell you double clicked\n\n' + info1 + info2 + info3 + info4 + info5 + info6 + info7);
}
Note: The event onDataCellDblClick can be activated before or after the DataGrid object is constructed (through go command).