Using the javascript datatable selection as opposed to DT::datatable selection

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
but the Selection extension will work see example here

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
but I dont know how to do it in a shiny context where the selected row would trigger a filter in a plot etc.

            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')

I guess you'd add a javascript callback to the DT that sets shiny input value binding.

found out that it was fixed in might be good to update the docs.

we an get the index of selected rows using the usual way:
where tbl is the
output$tbl assigned to the datatable output


This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.