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

Create Dynamic number of html.summary inside html.div using for loop

$
0
0

Hello All, I am creating a navigable dropdown tree where the data populates from JSON data. I am following this link.

Now, I want to create multiple html.summary inside html.div by iterating through lists from the JSON.

I tried this but got TypeError: Object of type 'generator' is not JSON serializable

html.Div(
      [
                                    html.Details(
                                        html.Summary(
                                            html.A(id=f"{portfolio}-link", children=[f"{portfolio}", html.I(className="far fa-arrow-alt-circle-right", id=f"{portfolio}-icon-1", style={'padding-left': '2px', 'color':'#C7C7C7'}),]),
                                        )for portfolio in portfolio_list
                                    ),
                                ],
                                style={'text-indent':'2em'}
                            )

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles