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

150
Visualizações
Bohek CustomCS callback failed

I am using Bokeh to do a dashboard and I would like to create a confirm button when user press on the confirm button, the saveButton will appear. The disabled property of saveButton will change from true to false. I have tried it with the following code and it seems like I have made something wrong. Should I pass the button arguments to Javascript? I am not very familiar with javascript. Thank you for your help

confirmButton = Button(label="Confirm Your Change", button_type="success")

callback = """
if (confirm("Confirm Saving?")) {
    saveButton.disabled = false;}

""" 
confirmButton.js_on_event(ButtonClick, CustomJS(code=callback))

saveButton = Button(label="Save", button_type="success",disabled=True)
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

If you want to activate the saveButton by one click (and this stays activated afterwards), simply create the two Buttons, use js_on_click() and pass as an argument the second button. Then you can set the disabled value to false.

confirmButton = Button(label="Confirm Your Change", button_type="success")
saveButton = Button(label="Save", button_type="success",disabled=True)
confirmButton.js_on_click(
    CustomJS(
        args=dict(saveButton = saveButton), 
        code="saveButton.disabled = false"
    )
)

If you want to toggle the status, use

code="saveButton.disabled = !saveButton.disabled"

inside the CustomJS function.

about 4 years ago · Santiago Gelvez Relatório
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