Open JasperSch opened 5 months ago
Looks like this is an upstream issue with DataTables, as the same problem can be reproduced in plain HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.datatables.net/1.13.8/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/autofill/2.6.0/css/autoFill.dataTables.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/autofill/2.6.0/js/dataTables.autoFill.min.js"></script>
</head>
<body>
<table id="mtcars" class="display" style="width: 100%; height: auto;"></table>
<script>
new DataTable("#mtcars", {
columns: [
{ title: "mpg" },
{ title: "cyl" },
{ title: "disp" },
{ title: "hp" },
{ title: "drat" },
{ title: "wt" },
{ title: "qsec" },
{ title: "vs" },
{ title: "am" },
{ title: "gear" },
{ title: "carb" }
] ,
data: [
[21, 6, 160, 110, 3.9, 2.62, 16.46, 0, 1, 4, 4],
[21, 6, 160, 110, 3.9, 2.875, 17.02, 0, 1, 4, 4],
[22.8, 4, 108, 93, 3.85, 2.32, 18.61, 1, 1, 4, 1],
[21.4, 6, 258, 110, 3.08, 3.215, 19.44, 1, 0, 3, 1],
[18.7, 8, 360, 175, 3.15, 3.44, 17.02, 0, 0, 3, 2],
[18.1, 6, 225, 105, 2.76, 3.46, 20.22, 1, 0, 3, 1]
],
autoFill: {
update: true
}
})
</script>
</body>
</html>
@mikmart Thank you for pinpointing the exact problem.
I'm less familiar with plain HTML code. Is there any way we could somehow enforce DT
to use a version of DataTables in which this feature was still working?
Since the problem in that case has nothing to do with this package, I will try to open an issue upstream at DataTables. Unfortunately it is not immediately clear to me where I should report this to the DataTable developers. I'll add a link here once I figure it out.
Is there any way we could somehow enforce
DT
to use a version of DataTables in which this feature was still working?
DT embeds a specific version of DataTables in each release, so unfortunately at the moment your only option is to try an older version of DT. It you search NEWS.md
for "upgraded DataTables" you should be able to find candidate DT versions.
Since the problem in that case has nothing to do with this package, I will try to open an issue upstream at DataTables.
That would be great, thank you!
@mikmart
Seems like it was indeed still working in the previous version of DT
. This can be used as a temporary solution:
remotes::install_version('DT', '0.30')
Reported the bug on their free community support page: https://datatables.net/forums/discussion/78109/bug-is-it-possible-to-fix-incremental-cell-dragging-autofill-extension#latest
Thanks for your help, let's hope they fix it soon.
Quick update: apparently it's already fixed in the upcoming version of DataTables:
So I guess this issue can be closed as soon as the needed releases have happened and the fix is incorporated in DT
.
Hi,
The
autoFill
extension doesn't properly increment values anymore but instead producesNaN
. It used to work at some point in time.MWE:
Drag a cell and click the increment button.
NaN
gets filled in:Tested browsers:
Chrome: Version 120.0.6099.129 (Official Build) (64-bit) Firefox: 122.0 (64-bit)
By filing an issue to this repo, I promise that
xfun::session_info('DT')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/DT')
.I understand that my issue may be closed if I don't fulfill my promises.