DataTables Filename Incrementation Bug When Displaying 10 Rows in Shiny Applications
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, r
Research direction
Start by reproducing the issue with the provided Shiny example and the DataTables Buttons CSV export, comparing downloads with exactly 10 displayed rows against other page lengths. Trace the filename-generation path used by the CSV button and confirm that the fix preserves incrementing without overwriting geo_table.csv.
Written by the indexing model from the issue text.
Description
I want to report a possible bug encountered in the DataTables extension for Shiny applications related to file name incrementation during the download of data tables.
The issue arises when using the 'Buttons' extension in DataTables to export table data. The filename incrementation behaves unexpectedly when exactly 10 rows are displayed in the data table, given the total number of rows in the data is equal to or more than 10. In such cases, the filename does not increment as expected upon download; instead, it overwrites the existing file.
However, when more or less than 10 rows are displayed in the data table, the filename increments correctly upon each download.
Here's a simplified example of the code I'm using:
output$geo_table <- DT::renderDataTable({
req(variables_geo$geo)
DT::datatable(variables_geo$geo,
rownames = FALSE,
extensions = 'Buttons',
options = list(
dom = 'Bfrtlip',
deferRender = TRUE,
lengthMenu = c(5, 10, 25, 50, 100, 1000, 10000),
buttons = list(
'colvis',
'copy',
list(
extend = 'csv',
filename = 'geo_table'
),
list(
extend = 'excel',
filename = 'geo_table'
),
list(
extend = 'pdf',
filename = 'geo_table'
),
'print'
)
)
)
})
When "Show 10 entries" selected and try to download .csv file, this overwrites the existing 'geo_table.csv' file.
I would appreciate if you could help with this issue. Please feel free to ask for any additional details that you may require.
Best regards,
- Dominant language
- JavaScript
- Stars
- 621
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/DT
-
Unecessary "Datatables warning" alert when creating a DT with new data and same number of columnsOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Excel like filteringOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
[workshop-sim] Improve: Provide a concrete example and activity checks in agentic intro (step 5)Openfeedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
githubnext/gh-aw-workshop#5715 ·
Maintainers usually reply within 1 day
-
[prefer-expect-resolves] autofix leaves a stray ")" when the awaited expression is parenthesizedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jest-community/eslint-plugin-jest#2052 ·
-
check:passed feeds:add
Difficulty 1/5 Under an hour Newbie friendliness 66/100
-
Wallet functions throws TypeError when the wallet has no account IDPossibly taken @Medhansh-741 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
hiero-ledger/hiero-sdk-js#4781 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100