I have been trying to create a very basic dash page that loads in data from an external database, peforms a search on that data and then puts the results in a table which can then be selected to output the selected rows as text at the bottom. e.g if i selected row a then clicked a button, “a” would show at the bottom of the page. When i try to use the selected_columns array, however, i get this error: nonexistent object was used in an State
of a Dash callback. The id of this object is selected_columns
and the property is value
. The string ids in the current layout are: [database, database_select, targets, submit_val, dataframe, load_data, outtest]
Despite this i have defined it in the layout here.
app = Dash(__name__, suppress_callback_exceptions=True)
app.layout = html.Div([
html.H3(id='database', children='Enter data and select database'),
html.Div([
html.Div(dcc.Dropdown(['PubMed', 'MGI'], 'PubMed', id='database_select')),
html.Div(dcc.Input(id="targets", type="text", placeholder="")),
html.Button('Submit', id='submit_val', n_clicks=0),
]),
html.Div(dash_table.DataTable(id = 'dataframe', row_selectable="multi", selected_rows=[])),
html.Div([
html.Button('load data', id='load_data', n_clicks=0),
html.P(id='outtest', children='')
])
])