Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!