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

Open a modal for a each row item in table

$
0
0

@sahanar17 wrote:

Hello All,

I am very new to dash. I am generating a dash html table and item in each row of a particular column is a link. When an item is clicked, I want a modal to open and display the contents of the selected item.

def Table(dataframe):
rows =
for i in range(len(dataframe)):
row =
for col in dataframe.columns:
value = dataframe.iloc[i][col]
# update this depending on which
# columns you want to show links for
# and what you want those links to be
if col == ‘id’:
cell = html.Td(html.A(href=value, children=value))
else:
cell = html.Td(children=value)
row.append(cell)
rows.append(html.Tr(row))
return html.Table(
# Header
[html.Tr([html.Th(col) for col in dataframe.columns])] +

    rows
)

Depending on the ‘value’ , I want to display the contents of modal. How can I do this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles