this may be a very easy question, still I'm quite stuck and can't seem to find a similar issue asked here in stackoverflow. I have the following sample dataframe:
df2 = data.frame(RTG=c("A+","A+","AA","AA"),CITY=c("A","B","C","D"), stringsAsFactors = T)
Then, I create the following datatable:
datatable(df2,
rownames= T,
colnames = T,
filter = c('top'),
extensions = "Buttons",
options = list(scrollX = T
, lengthChange = T
, paging = T
, autoWidth = F
, pageLength = T
, dom = 'Blfrtip'
, info = T
, searching = F
))
If I use the RTG filter and select 'AA', also rows with RTG = 'A+' shows up. This seems to make no sense to me. What am I missing? Thank you
By setting the option searching = F
you deactivated the searching capabilities completely. If you want to get rid of the search field for the whole table while keeping the column filters just remove the "f" from the dom
option.
df2 = data.frame(RTG=c("A+","A+","AB","AA"),CITY=c("A","B","C","D"), stringsAsFactors = T)
DT::datatable(
df2,
rownames = T,
colnames = T,
filter = list(position = 'top'),
extensions = "Buttons",
options = list(
scrollX = T,
lengthChange = T,
paging = T,
autoWidth = F,
pageLength = 5,
dom = 'Blrtip',
info = TRUE,
dom = `t`
))