plotly / dash-table

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
420 stars 74 forks source link

Export not working when dash_core_components are imported #902

Closed daniel1608 closed 3 years ago

daniel1608 commented 3 years ago

Hi,

I have a very simple app.

import dash
import dash_table
#import dash_core_components as dcc

app = dash.Dash(__name__)

app.layout = dash_table.DataTable(
    id="table",
    columns=[{"name": "col1", "id": "col1"}],
    data=[{"col1": 1}],
    export_format="csv",
)

if __name__ == "__main__":
    app.run_server(debug=True)

If I start it and click on the Export button, a csv file gets downloaded. But if I uncomment line 3 and import dash_core_components the export button isn't working anymore.

What am I doing wrong?

Installed versions: dash==1.20.0 dash-core-components==1.16.0 dash-table==4.11.3

alexcjohnson commented 3 years ago

Thanks for the report @daniel1608 - I'm not able to reproduce though, the export button works for me in either case, with the same output. Can you say more about your environment? What browser, OS? Do you have an assets/ directory loading any other files? Do you see any error messages when clicking the export button, either on screen or in the JavaScript console? (there's a Warning: Each child in a list should have a unique "key" prop. message in the JS console on render - this is a known issue. I just want to know if you see any other messages, particularly when you click the button.)

daniel1608 commented 3 years ago

@alexcjohnson, thanks for the quick answer. The reason is indeed the assets folder. When I delete it, everything works as expected. Looks like some script in there is responsible for my problem.

Sorry for the inconvenience.