Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
Dash unselect datatable cell when closing dbc.modal

I am actually working on a dash project. In this one, I have a datatable which is updated each 5 seconds. When I click on a cell of the datatable (= when active_cell is not None), the is_open parameter of my modal is set to true and values depending on the selected cell are pushed to the modal.

Only problem : while the modal is opened, the datas must be automatically actualized depending on the datatable evolution (=datatable is an input in my callback). But the problem is that when I close the modal manually, it will keep opening again and again each time the datatable is updated (because the cell is still active).

So here I come to my question : How can I unselect the cell when I close the modal ? Because active_cell is an input in the callback so I can't update it in the same callback. Here is the code of my callback :

@app.callback(Output('graph', 'figure'),
              Output('modal_graph', 'is_open'),
              Input('tbl', 'active_cell'),
              Input('tbl', 'data'),
              )
def update_graphs(active_cell, datatb):
    datas = FundamentalDatas.instance()
    if active_cell and (active_cell['column'] != 0):
        try:
            return datas.create_graph(active_cell, datatb), True
        except Exception:
            raise PreventUpdate
    else:
        raise PreventUpdate

Thanks by advance !

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda