-
Notifications
You must be signed in to change notification settings - Fork 179
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
classNameDefinedColumns() now identifies negative and "_all" targets #512
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add an item in NEWS.md?
My bad, added. For the case 3 |
I have no idea. As long as #511 is fixed, I don't really care much for now. Thanks! |
FYI Although the examples @shrektan created for these cases seem to work, I can still recreate issue if the first column is an integer using version 0.4.2 from GitHub (see screenshot and example below). DT::datatable(
sapply(iris[,1:3], as.integer),
options = list(
columnDefs = list(
list(className = "dt-center", targets = "_all")
)
)
) In the above example, the issue goes away if the data is in a data.frame rather than a matrix, but I can also reproduce the issue in a shiny app where the input is a data.frame (see screenshot below) |
@vnijs My bad. It must be something related to the row names... Will file a patch now... Apologize for the trouble. |
No trouble all @shrektan. I'm grateful for your time and effort |
closes #511
The fix #476 misses the fact that besides of column indexes, there're 4 kinds of
columnDefs.targets
in total.A string - class name will be matched on the TH for the column (without a leading .)See the comment below.This PR is meant to handle all the rest cases. However, for case 3, I can't reproduce the effect in the first place. What I mean is explained by the following example:
UPDATE 20180425 This is because
DT
sends out the data as an array instead of an object. So thedatatables
library itself doesn't know the column names of each column.For 1, 2 and 4 cases, they are correctly handled now.