Hi again,
I’m currently trying to build my own version of an editable Table/Upload component with callbacks firing for upload and edit etc, mixing some of the example components given in the Dash documentation. That means, I need a predefined table when in which i inject the data from my uplaod. However I lack a complete understanding of the Data Table functionality it seems. Let me elaborate on this:
In the first example here
https://dash.plot.ly/dash-core-components/upload
the table is used in a way that injects the newly created table into the container element. First thing I do not understand: Why do we need this part in the original layout (see comment):
app.layout = html.Div([
dcc.Upload(
id='upload-data',
children=html.Div([
'Drag and Drop or ',
html.A('Select Files')
]),
style={
'width': '100%',
'height': '60px',
'lineHeight': '60px',
'borderWidth': '1px',
'borderStyle': 'dashed',
'borderRadius': '5px',
'textAlign': 'center',
'margin': '10px'
},
# Allow multiple files to be uploaded
multiple=True
),
html.Div(id='output-data-upload'),
html.Div(dt.DataTable(rows=[{}]), style={'display': 'none'}) # THIS RIGHT HERE
])
The element that gets its child elements injected should be the output-data-upload, so the next div serves no apparent function whatsoever, because the parse_contents function injects the table into the upper div. But the whole thing doesnt work when we remove it.
Can anyone explain?