This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
v1.1.0 datatable hidden_columns/exporting loses hidden headers when export_header='names' #546
Labels
dash-type-bug
Something isn't working as intended
dash-type-enhancement
New feature or request
size: 1
Milestone
Hi there,
hidden_columns in 1.1.0 has really helped me a lot, however, here comes the question with exporting:
After using hidden_columns to hide some of the columns, I need to export data(no matter what is displayed after hiding several columns or the whole table).
It seems that the data of hidden columns will be exported anyway but the headers of them will not if I set export_headers='names'. It just leaves several data without headers.
I think the "ids" or the "names" should be same for the headers but the content, therefore, could I believe that there might be something wrong?
Here is a demo code to show that problem:
`import dash
import dash_table
app = dash.Dash(name)
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in ['a', 'b', 'c', 'd']],
data=[{'a':1, 'b':1, 'c':1, 'd':1}, {'a':1, 'b':1, 'c':1, 'd':1},{'a':1, 'b':1, 'c':1, 'd':1},{'a':1, 'b':1, 'c':1, 'd':1}],
hidden_columns=['d'],
export_format='csv',
export_headers='names'
)
if name == 'main':
app.run_server(debug=True)`
And the csv looks like:
The text was updated successfully, but these errors were encountered: