Hi guys,
This is more a report for the Plotly team. I encounter problems where I could not keep data into a Datatable, because every new input into the table will automatically refresh the page, (FYI flask being in debug mode).
I was working on a project with the following versions - everything works as expected.
dash==0.28.6
dash-core-components==0.37.0
dash-html-components==0.13.2
dash-renderer==0.14.3
dash-table==3.2.0
then I just decided to update the different version and I encounter the problem with the table reloading my whole page to every single changes, with the following versions :
dash==0.36.0
dash-core-components==0.43.0
dash-html-components==0.13.5
dash-renderer==0.17.0
dash-table==3.3.0
So last try, I tried downgrading the others module and update Dash :
dash==0.36.0
dash-core-components==0.37.0
dash-html-components==0.13.2
dash-renderer==0.14.3
dash-table==3.2.0
And these gave me the error message : ‘Error loading depedencies’
Anyway, I went back to the first version for the moment because everything was working fine.
I just hope to help you guys resolve or at least detect the issue.
Here is the (incomplete) code if needed :
app = dash.Dash(__name__)
app.layout = html.Div(
children = [
dcc.Dropdown(
id = 'dropdown-roster-site',
options = list_option_venues,
placeholder = 'Choose Venues',
value = [],
className = 'dropdown-roster-site'),
html.Div(
children = [
dash_table.DataTable(
style_table={'width' : '650'},
id='table-roster-site',
editable = True,
data=df_roster.to_dict('rows'),
columns=[{'id': c, 'name': c} for c in df_roster.columns]
),
@app.callback(
Output(component_id='table-roster-site', component_property='data'),
[Input(component_id='dropdown-roster-site', component_property='value')]
)
def update_table_material_delivery(value) :
new_df_material = df_roster.loc[value].reset_index()
data = new_df_material.to_dict("rows")
return data
@app.callback(
Output(component_id='table-roster-site', component_property='columns'),
[Input(component_id='dropdown-roster-site', component_property='value')]
)
def update_table_material_delivery(value) :
new_df_material = df_roster.loc[value].reset_index()
columns = [{'name' : i, 'id' : i} for i in new_df_material.columns]
return columns
@app.callback(
Output('empty-div-2', 'children'),
[Input('table-roster-site', 'data')],
[State('dropdown-roster-site', 'value')])
def get_data(data, value) :
dataframe = pd.DataFrame(data)
now = datetime.datetime.now().strftime("%Y-%m-%d")
dataframe.to_excel(str(Path.cwd())+'\\assets\\'+str(value)+'_'+str(now)+'.xlsx')