I have been working with version 0.12.14 in the past using an on_change callback bound to the selected property of a column data source in a Bokeh server like the following:
Source.on_change ('selected', py_function)
This worked well for triggering row selection changes initiated from extended models using JavaScript/typescript by simply replacing the 'selected' dictionary with a new definition.
Sel = self.model.source.selected
Sel['1d']['indices'] = [selected_index]
self.model.source.selected = Sel
At this point, the py_function on the Bokeh server would execute and contain the updated source.selected property.
Since 0.12.15 I think the implementation of the 'selected' property for column data sources has changed. Now, the py_function no longer fires. I have tried variations of self.model.source.selected.change.emit() without success. My solution at the moment, since I am extending the Bokeh models, is to just add a new 'selected_row' property to this model and trigger on change events the same as before.
Is there a better way to accomplish this? If so,how can I properly achieve the same functionality of triggering the python function on the server from javascript in version 0.12.16?
Can you provide a minimal complete example? You also mention data tables, and it should be mentioned there are some known regressions to data table 0.12.16 so we would need a complete example to run to determine where the actual problem lies.
I have been working with version 0.12.14 in the past using an on_change callback bound to the selected property of a column data source in a Bokeh server like the following:
Source.on_change ('selected', py_function)
This worked well for triggering row selection changes initiated from extended models using JavaScript/typescript by simply replacing the 'selected' dictionary with a new definition.
Sel = self.model.source.selected
Sel['1d']['indices'] = [selected_index]
self.model.source.selected = Sel
At this point, the py_function on the Bokeh server would execute and contain the updated source.selected property.
Since 0.12.15 I think the implementation of the 'selected' property for column data sources has changed. Now, the py_function no longer fires. I have tried variations of self.model.source.selected.change.emit() without success. My solution at the moment, since I am extending the Bokeh models, is to just add a new 'selected_row' property to this model and trigger on change events the same as before.
Is there a better way to accomplish this? If so,how can I properly achieve the same functionality of triggering the python function on the server from javascript in version 0.12.16?