Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to have the column formatting also apply to values shown in filter sliders? #247

Closed
GitChub opened this issue Mar 16, 2016 · 8 comments · Fixed by #1119
Closed
Assignees

Comments

@GitChub
Copy link

GitChub commented Mar 16, 2016

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%).

@GitChub GitChub changed the title Is it possible to have the column formatting also apply to filter sliders? Is it possible to have the column formatting also apply to values shown in filter sliders? Mar 16, 2016
@yihui
Copy link
Member

yihui commented Mar 17, 2016

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!

@ppagnone
Copy link

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

@dokato
Copy link

dokato commented Aug 9, 2018

+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)
    )
  }
  )
)

screen shot 2018-08-09 at 12 45 14

@philibe
Copy link

philibe commented Nov 29, 2018

👍 (A user tells me this today) Thanks in advance

@mrcaseb
Copy link

mrcaseb commented Jul 29, 2020

This is still a thing. Are the developers planning to fix this?

@shrektan shrektan self-assigned this Sep 3, 2020
@llrs
Copy link

llrs commented Sep 4, 2023

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)

@yihui
Copy link
Member

yihui commented Sep 11, 2023

No updates. Sorry. If gt or any other packages can do the job, yes, please consider using them.

@yihui
Copy link
Member

yihui commented Jan 24, 2024

Great new! @mikmart has just helped implement this feature. You can try the development version:

remotes::install_github('rstudio/DT')

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants