DT icon indicating copy to clipboard operation
DT copied to clipboard

Allows custom column filter placeholder

Open andyquinterom opened this issue 2 years ago • 3 comments
trafficstars

This PR allows users to set a custom placeholder for column filters. Currently, it is hard coded to 'All' which makes it almost impossible to setup easily in other languages. (At our company we use Spanish).

This would be really helpful.

andyquinterom avatar Feb 08 '23 19:02 andyquinterom

It seems you want to change the language globally (to Spanish), so I think a cleaner approach may be using a global option, e.g., options(DT.columnFilterPlaceholder = ...). That means this PR can be simplified---just replace 'All' with getOption('DT.columnFilterPlaceholder', 'All'). Would you be okay with that?

datatable() has already had too many arguments, and I tend not to add more.

Sounds good to me. Shouldnt there be an API that's easier to access for users? since there would be two forms of internationalization, the JSON file passed on to the options.language.url and now this. I understand DataTables is a separate project, but a unified API for Shiny users could be cool to see. I could sit down for a while and think of some sort of unified API for DT internationalization.

What do you think?

andyquinterom avatar Feb 12 '23 18:02 andyquinterom

Yes, a unified API is definitely a good idea. Please feel free to make suggestions. Thanks!

yihui avatar Feb 13 '23 22:02 yihui

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 08 '23 16:11 CLAassistant