☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Updating a variable using HTML input checkbox

Community Support
esolak
esolak

Hi,

I want to bind an event to an HTML input checkbox in a table cell.

Minimally, I have something like,

my_number = 2
columns = [TableColumn(field="visible",
                           title="ON",
                           width=20,
                           formatter=HTMLTemplateFormatter(
                               template='<input type="checkbox" <%= value %>>'))]

I want to update the variable my_number when checkbox is checked/unchecked.

I couldn’t figure out how to write a callback that is triggered by an HTML element.

Many thanks

–Ercan

⌁   Link to post
p-himik
p-himik

The issue is that the HTMLTemplateFormatter doesn’t have any way to reference any existing model without devolving to some shaky magic.
The cleanest and the most robust solution would be to just create a custom CellFormatter subtype. How exactly - depends on the details.

⌁   Link to post

End of archived discussion · Replies are disabled