Skip to content

OnRowDoubleClick - cCJGrid

Called when a user double clicks on a data row / column

Type: Event

Parameters

Parameter Type Description
iRow Integer The row number selected
iCol Integer The column number selected

Syntax

Procedure OnRowDoubleClick Integer iRow Integer iCol

Description

OnRowDoubleClick is called when the user double clicks on a data cell. This does nothing and is suitable for augmentation. This will usually be used when row editing is not supported and you wish to use the double click event to perform a custom process such as popping up a dialog.

Before this is called, the SelectedRow is moved to the row that was clicked, so iRow should be the SelectedRow. The column passed may be set as the SelectedColumn but it may not depending on pbFocusSubItems and the focus status of the column.

Procedure OnRowDoubleClick Integer iRow Integer iColumn
    Boolean bOk 
    Forward Send OnRowDoubleClick iRow iColumn
    Get EditRowPopup to bOk
End_Procedure

// popup an edit panel for the selected row.
Function EditRowPopup Returns Boolean
    Boolean bOk
    tTableDataLine DataLine
    Get SelectedRowValue of oName to DataLine.sName
    Get SelectedRowValue of oType to DataLine.sType
    Get SelectedRowValue of oSize to DataLine.iSize
    Get SelectedRowValue of oDescription to DataLine.sDescription

    Get GetTableData of oDataPopup (&DataLine) to bOk                

    If bOk Begin
        Send UpdateCurrentValue of oName  DataLine.sName
        Send UpdateCurrentValue of oType  DataLine.sType
        Send UpdateCurrentValue of oSize  DataLine.iSize
        Send UpdateCurrentValue of oDescription DataLine.sDescription

        Send Request_Save
    End

    Function_Return bOk
End_Function

If this is used with grids that support editing, this might be called when the edit control is active. When this happens, you probably do not want to process the double click. You can check for this by checking the IsEditMode function.

Procedure OnRowDoubleClick Integer iRow Integer iColumn
    Boolean bIsEdit
    Forward Send OnRowDoubleClick iRow iColumn
    Get IsEditMode to bIsEdit
    If bIsEdit Begin
        Procedure_Return
    End
    :
End_Procedure

If pbEditOnClick is set to True, OnRowDoubleClick will not fire for editable columns, since the first click starts edit mode for that column.