Skip to content

Instantly share code, notes, and snippets.

@lrasmus
Created October 16, 2019 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrasmus/f0eee2550faa02cc9733731c30971af4 to your computer and use it in GitHub Desktop.
Save lrasmus/f0eee2550faa02cc9733731c30971af4 to your computer and use it in GitHub Desktop.
Test DT regex highlighting
devtools::install_github('lrasmus/DT', ref="423_highlight_regex")
library(shiny)
library(devtools)
library(DT)
ui <- fluidPage(fluidRow(column(12, DT::dataTableOutput("test"))))
server <- function(input, output) {
mtcars$model = rownames(mtcars)
rownames(mtcars) = NULL
output$test <- renderDataTable({
datatable(mtcars, options = list(
searchHighlight = TRUE,
search = list(regex = TRUE)
#search = list(regex = FALSE)
))
})
}
shinyApp(ui = ui, server = server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment