-
Notifications
You must be signed in to change notification settings - Fork 182
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
Enabling R styling via a new param formatter
#949
base: main
Are you sure you want to change the base?
Conversation
Merge branch 'allow-string-targets' into styling # Conflicts: # R/datatables.R
Now I think this feature is not suitable for DT as it becomes more complicated than I thought. I don't wanna introduce any complexity into DT as it's already a big project. Close it for now. |
It's was a very good try. Thanks. (Sob). Perhaps later ? :) |
Merge remote-tracking branch 'origin/main' into styling # Conflicts: # DESCRIPTION # NEWS.md # R/datatables.R # man/datatable.Rd # tests/testit/test-datatables.R
This reopened issue gives me the opportunity to thank you for your work on DT. When I first installed DT in early 2018, for me it was a simple adaptation of datatable.net, but now that I'm trying to use datatable.net with Flask Rest and VueJs 3 I see that I have to rewrite a lot of things which I thought was in datatable.net but actually written in the server side of DT, and I understand how your API wrapping initial datatable.net ones in the front side. |
|
Closes #938 #652 #990
DT implements many nice JS wrappers on styling the columns. However, R users may still find they want to implement their own style, as the love for beautiful table never ends. They can do it in two ways:
render
options, i.e.,datatable(..., options = list( columnDefs = list( list(targets = 1, render = JS(...)))))
escape
argument toFALSE
.Unfortunately, those two methods are either difficult to implement or contain side-effects:
columnDefs.render
optionformattable
The new param
formatter
allows users to write formatting functions in R without losing the ability to sort, filter or search by retaining the raw data "untouched" as it creates invisible helper columns.TODO
list(function() ... , targets = ...)
Example