I have not been able to find a clear example that shows how to implement in shiny the FixedColumns extension for DataTables (
).
Could someone post a complete example or tutorial of some kind on this? It seems like an essential functionality, to be able to freeze 1 or more columns in a data table. There are clear examples written in javascript, and there are examples of various callbacks in renderDataTable options, but I can't get FixedColumns working... This has been asked on stackoverflow and elsewhere but without a clear (to me, anyway) answer.
I think I have to first include the FixedColumns javascript, which might be done as described here?
Then, for example if I have some code like the following, what is the syntax that freezes the first 3 columns?
output$colsout <- renderDataTable(
mycols,
options=list(
scrollX= TRUE,
scrollY= "500px",
scrollCollapse= TRUE,
lengthMenu = list(c(10, 200, -1), c('10', '100', 'All')),
pageLength = 100,
columnDefs = list(list(width="440px", targets=list(0))), # make the 1st column wide
**** INSERT WHAT CODE HERE? ***
)
)