Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda