DT
DT copied to clipboard
Feature/complex headers
Fixes rstudio#418.
This version builds on original suggestions from @chrisvwn.
It creates a function that reads multi-row headers into an array of arrays, where each array row is a header row.
Further it updates csv, copy, pdf, excel and print to process the multi-row header object.
For excel it merges the cells as shown on screen.
It supports colVis
It does not update the flash counter parts of html5 functions
@yihui I share the same concern, too. These are not simple hacks. Even if we find out a way to upgrade the js files with this patch maintained (one possible way is to apply a git patch), I can't guarantee it will always work in the future because the upstream source may contain big changes.
I incline that this PR is more suitable for the upstream js library but you have more experience on the topic of maintainance.
Absolutely. If this could be done in the upstream library instead, we can easily pick it up from there in the future.
Thank you @yihui and @shrektan for your review and comments. I wasn't aware that the code was auto-imported via script and I understand your concerns.
In the upstream library there is an open PR (https://github.com/DataTables/Buttons/pull/55) with similar topic. However, it has been open over 5 years ago with last comment (https://github.com/DataTables/Buttons/pull/55#issuecomment-540957219) from @Datatables is a bit ambiguous in how they want to proceed.
I'm not sure I have the time now to reproduce my solution at a fork of https://github.com/DataTables/Buttons, but if I do I might try.
I'll ask @Datatables if they would be interested in that before proceeding.
So I take you'd prefer not to merge this PR, right?
That's right.
The worst case is that if users really want this, we provide an R script or function to download the patched version of these JS files and replace the ones in DT. Of course, we should also warn them that the next time they update DT, they should run the R script or function again.
Dear @yihui and @shrektan.
I just submitted https://github.com/DataTables/Buttons/pull/170 to the upstream library, as you suggested.
I suggest you keep this PR open and close it when/if upstream changes are taken up and picked-up by you.
Best regards,
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.