Reputation: 63984
I have the following self-sufficient Shiny script:
mydf <- data.frame(commonality=c("common","uncommon","common","uncommon","common"),value=c(1,2,3,4,5))
library(shiny)
shinyApp(
ui = fluidPage(DT::dataTableOutput('tbl')),
server = function(input, output) {
output$tbl = DT::renderDataTable(
mydf, options = list(lengthChange = FALSE)
)
}
)
Which produces this:
What I want to do is to do exact search. For example when I type common
,
the values uncommon
should not appear. How can I do that?
Upvotes: 1
Views: 728
Reputation: 517
You can use the filter of the DT package :
library(shiny)
shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')),
server = function(input, output) {
output$tbl = DT::renderDataTable( mydf,filter = 'top', options = list(lengthChange = T, dom = 'tip') )
})
and the result look like this :
Upvotes: 1