option one:use callback
option two âŚI got stuck so confused
show the current code i have written:
import dash
import dash_core_components as dcc
import dash_html_components as html
from DBConnection import getData
from utils import make_dash_table
from dash.dependencies import Output, State, Input
import json
app = dash.Dash()
server=app.server
app.layout = html.Div([
dcc.Input(id=âusernameâ, value=âInitial Valueâ, type=âtextâ),
html.Button(id=âsubmit-buttonâ, type=âsubmitâ, children=âSubmitâ),
html.Div(id=âoutput_divâ),
# ç¨äşĺĺ¨ä¸é´ĺźçHidden Divă
html.Div( id=âintermediate-valueâ, style={âdisplayâ: ânoneâ} ),
html.Div(
[
html.H6(
[âćŁç´˘çťćčĄ¨ć źâ],
className=âsubtitle paddedâ,
),
html.Table(
id=âtableâ,
className=âtiny-headerâ,
),
],)
])
@app.callback(Output(âoutput_divâ, âchildrenâ),
[Input(âsubmit-buttonâ, ân_clicksâ)],
[State(âusernameâ, âvalueâ)],
)
def update_output(clicks, input_value):
if clicks is not None:
return input_value
if name == âmainâ:
app.run_server(debug=True)
Looing forward the advanced programmerâs advice and help.