Data table column filters do not display properly in Shiny (using DT package)

I have a data table that I make brilliant using the DT package. Each individual column has a filter at the top. All column filters work, but the formatting is somewhat strange.  Screenshot with column filters

As you can see, some filters have the word “Everything” inside them, and they function correctly, when you enter them, the word that you enter appears.

However, some of them do not work, and when I enter them, the filtering mechanism works (as in the correct lines, it is filtered out), but you cannot see which filter you entered. It seems that the cursor is a way to the left of the field and is not visible.

The code I use to display the data table is below:

DT::renderDataTable(X,
                    options = list(pageLength = 10, 
                                   searching = TRUE,
                                   autoWidth = TRUE,
                                   columnDefs = list(list(className = 'dt-center', targets = "_all"))
                                   ),
                   filter = "top"
                   )
+4
source share
2 answers

(Still) Trying to solve another problem, I set it paddingto zero in CSS for .has-feedback .form-controland at least now I can see "Everything" in each filter cell. More specific:

.has-feedback .form-control {
  padding-right: 0px;
}

Hope this helps.

PS It's easy to play around with this material using the right-click and “check” features of Chrome (and, I think, Firefox).

+2
source

, DT:: renderDataTable, ( DT:: renderDataTable) (.. ). server = FALSE, ...

+1

Source: https://habr.com/ru/post/1624852/


All Articles