Hello,
I am trying to use a DT::datatable options with fixed columns and row selection.
The built-in DT selection won't work as documented https://github.com/rstudio/DT/issues/275
but the Selection extension will work see example here
https://datatables.net/release-datatables/extensions/FixedColumns/examples/integration/select.html.
My question is what is the right way to get the index of the selected row when using the datatable javascript built-in selection as opposed to the one from DT ?.
there is this link https://datatables.net/extensions/select/examples/api/get.html
but I dont know how to do it in a shiny context where the selected row would trigger a filter in a plot etc.
datatable(mtcars,
selection = "none",
extensions = c('Select', 'Buttons',"FixedColumns", "FixedHeader", "Scroller"),
options = list(
dom = 'Blfrtip',
select = list(style = 'os', items = 'row'),
buttons = c('selectAll', 'selectNone', 'selectRows'),
scroller = TRUE,
scrollX = TRUE,
scrollY = "780px",
fixedHeader = TRUE,
class = 'cell-border stripe',
fixedColumns = list(leftColumns = 2,heightMatch = 'none')
)
)