You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to put default filters on a DT::datatable in a shiny application. I'm able to get the default filters in place, but removing the filters is not behaving as I would expect.
Notice that the filter box doesn't have the x in a circle to clear out the filter. If I click in the box and click out without making changes, the circle will appear, but will take no action when clicked. The only way to clear the filter is to select a value and then clear out the values as I would if I hadn't preloaded the filters.
Anyone else had this problem before?
EDIT: Hopefully this really cheesy imagery helps clarify the discrepancy between the two. I'm using DT version 0.1.57 (most recent on GitHub)
The text was updated successfully, but these errors were encountered:
Duplicate posting from Stack Overflow. (http://stackoverflow.com/questions/38307495/dtdatatable-clearing-default-filters)
I would like to put default filters on a
DT::datatablein a shiny application. I'm able to get the default filters in place, but removing the filters is not behaving as I would expect.Example 1
An example of a datatable with no filters:
Notice that in this example, when you manually select "3" under the
gearcolumn, a little gray box appears that let's you know "3" is selected.Then, when you are out of the filter selection, there is a little x in a circle that lets you clear the filter.
Example 2
In this example, I've preloaded "3" into the filter when the datatable loads.
shinyApp( ui = fluidPage( DT::dataTableOutput("mtcars") ), server = shinyServer(function(input, output, session){ output$mtcars <- DT::renderDataTable({ mtcars$gear <- factor(as.character(mtcars$gear)) datatable( data = mtcars, filter = "top", options = list( pageLength = 50, searchCols = list(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, list(search = '["3"]'), NULL) ) ) }) }) )Notice that the filter box doesn't have the x in a circle to clear out the filter. If I click in the box and click out without making changes, the circle will appear, but will take no action when clicked. The only way to clear the filter is to select a value and then clear out the values as I would if I hadn't preloaded the filters.
Anyone else had this problem before?
EDIT: Hopefully this really cheesy imagery helps clarify the discrepancy between the two. I'm using DT version 0.1.57 (most recent on GitHub)
The text was updated successfully, but these errors were encountered: