Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

dcc.DatePickerRange error

$
0
0

@IceOriental123 wrote:

Hello!

I am trying to get a DatePickerRange component to alter a table. However, I am getting an error when i attempt to do so.

Here is the section of the app.layout code itself.

app.layout = html.Div(
className=“row”,
children=[
html.Div(
dash_table.DataTable(
id=‘table-sorting-filtering’,
columns=[
{‘name’: i, ‘id’: i, ‘deletable’: True} for i in sorted(df.columns)
],
page_current= 0,
page_size= 31,
page_action=‘custom’,
filter_action=‘custom’,
filter_query=’’,
sort_action=‘custom’,
sort_mode=‘multi’,
sort_by=,
),
style={‘height’: 750, ‘overflowY’: ‘scroll’},
className=‘six columns’
),

    html.A('Download CSV', id='my-link'),

    html.Div(
        dcc.DatePickerRange(
            id='my-date-picker-range',
            min_date_allowed=dt(2019, 8, 15),
            max_date_allowed=dt(2019, 8, 29),
            initial_visible_month=dt(2019, 8, 15),
            end_date=dt(2019, 8, 29)
        ),
        html.Div(id='output-container-date-picker-range')
    ),

    html.Div(
        id='table-paging-with-graph-container',
        className="five columns"
    ),    
    dcc.Interval(id='interval_component', interval = 5000, n_intervals=0)
]

)

here is the error in the Terminal

Traceback (most recent call last):
File “app.py”, line 52, in
html.Div(id=‘output-container-date-picker-range’)
File “C:\Users\TP_baseline\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dash\development\base_component.py”, line 352, in wrapper
return func(*args, **kwargs)
File “C:\Users\TP_baseline\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dash_html_components\Div.py”, line 63, in init
super(Div, self).init(children=children, **args)
File “C:\Users\TP_baseline\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dash\development\base_component.py”, line 122, in init
“Prop {} has value {}\n”.format(k, repr(v))
TypeError: The dash_html_components.Div component (version 1.0.2) with the ID “Div(id=‘output-container-date-picker-range’)” detected a Component for a prop other than children
Did you forget to wrap multiple children in an array?
Prop id has value Div(id=‘output-container-date-picker-range’)

Please assist with solving the error. And is this even the right way to structure a datepickerrange to interact with the table?

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles