The output of this function may be used as the callback argument to datatable. Event listeners for dblclick and contextmenu are added to the datatable. These event listeners set a shiny input, so that you can listen to these events on the R-side with observeEvent. See 'Details' for the properties of the added inputs.

datatable_callback(inputId)

Arguments

inputId

Typically the outputId used for displaying the corresponding datatable.

Details

The callback adds the following inputs: input$<inputId>_row_dblclicked and input$<inputId>_row_contextmenued, where <inputId> is replaced by the parameter inputId passed to this function. These inputs have the following properties:

<inputId>_row_dblclicked

rowThe index of the dblclicked row.
idThe value of the first column of the dblclicked row. It is convenient to create unique ids for every row in the first column of a table passed to datatable and hiding this column via the options argument.
dataThe data of the dblclicked row.
rndA random number.

<inputId>_row_contextmenued

rowThe index of the dblclicked row.
idThe value of the first column of the dblclicked row. It is convenient to create unique ids for every row in the first column of a table passed to datatable and hiding this column via the options argument.
dataThe data of the dblclicked row.
mouseA list with elements named x and y holding the position of the mouse in px, when the datatable was contextmenued.
rndA random number.