I can't correctly position the l
ength changing and the f
iltering input to the top-right and bottom-left respectively on my DT::datatable
output in shiny
using the dom
option. Code:
library(shiny)
library(DT)
set.seed(2282018)
company <- data.frame(Company = letters[1:10], Sales = scales::dollar(runif(10, 200, 1230)), stringsAsFactors = F)
# UI ----
ui <- function(){
fluidPage(
sidebarLayout(
sidebarPanel(numericInput("nums", label = "Num Input", value = 1, min = 1, max = 10)),
mainPanel(dataTableOutput("mytable"))
)
)
}
# server ----
server <- function(input, output, session){
output$mytable <- renderDataTable({
datatable(company,
caption = tags$caption("StackOverflow Example"),
filter = "none",
options = list(
autoWidth = T,
pageLength = 10,
scrollCollapse = T,
dom = '<"right"l>t<"left"f>')
)
})
}
runApp(list(ui = ui, server = server))
As stated before, my goal is to move l
to the top right and f
to the bottom left.
Thanks!