Skip to content
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

DataTables Filename Incrementation Bug When Displaying 10 Rows in Shiny Applications #1076

Open
cnrakt opened this issue Jul 17, 2023 · 0 comments

Comments

@cnrakt
Copy link

cnrakt commented Jul 17, 2023

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant