How can we display filter options within shiny as shown in R below:
https://rstudio.github.io/DT/008-filter.html
shinyApp(
ui = fluidPage(
fluidRow(
column(12,
dataTableOutput('table')
)
)
),
server = function(input, output) {
output$table <- renderDataTable(iris,
options = list(
pageLength = 5,
initComplete = I("function(settings, json) {alert('Done.');}")
)
)
}
)
Tried both ways providing filter as an argument but did not produce filter option
output$table <- renderDataTable(iris,
filter = "top",
options = list(
pageLength = 5,
initComplete = I("function(settings, json) {alert('Done.');}")
)
output$table <- renderDataTable(iris,
options = list(
pageLength = 5,
list(autoWidth = TRUE), filter = list(
position = 'top'
))
)