DT
DT copied to clipboard
Is it possible to have the column formatting also apply to values shown in filter sliders?
For example, I can use "formatPercentage" to format the values in a column to look like percentages (e.g. 2.50% (with "digits = 2") instead of 0.025), but the values shown on the filter slider still look unformatted (e.g. 0.025 instead of 2.50%).
That is a very good question. I did consider this in the past, and it was not very straightforward to implement. I'll try again in the future. Thanks!
I am having the same problem in this moment and I saw this. I take advantage to ask about a similar problem.
DT offer the possibility to use other column to order with "orderData" in "columnDefs". In my case column1 is order by column2 (this is hidden) because I am doing some modifications in the way of show column1.
Can filters input support the same ? Can I indicate that filter in column1 must to work with data of column2 (the hidden column) ?
Thanks in advance
+1 to that
That's a minimal example, which helps to reproduce the problem.
runApp(
list(ui = fluidPage(
DT::dataTableOutput("mytable")
),
server = function(input, output, session) {
output$mytable <- DT::renderDataTable(
DT::datatable(iris*10,
options = list(pageLength = 10,
columnDefs = list(list(className = 'dt-left',
targets = 0:4))
),
filter = c("top")) %>%
formatRound(1:4, 0)
)
}
)
)
:+1: (A user tells me this today) Thanks in advance
This is still a thing. Are the developers planning to fix this?
Many thanks for the great package!
Any updates on this? Or is the recommended approach to use gt? (I see it has several pages about shiny)
No updates. Sorry. If gt or any other packages can do the job, yes, please consider using them.
Great new! @mikmart has just helped implement this feature. You can try the development version:
remotes::install_github('rstudio/DT')
Thanks everyone!