Description Usage Arguments Details
View source: R/datatable_callback.R
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.
1 | datatable_callback(inputId)
|
inputId |
Typically the |
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
row | The index of the dblclicked row. |
id | The 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. |
data | The data of the dblclicked row. |
rnd | A random number. |
<inputId>_row_contextmenued
row | The index of the dblclicked row. |
id | The 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. |
data | The data of the dblclicked row. |
mouse | A list with elements named x and y
holding the position of the mouse in px, when the datatable was
contextmenued. |
rnd | A random number. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.