Updating a variable using HTML input checkbox

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

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.