Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python bokeh deselect data table rows

I want to be able to "reset" a data table. How do I do that?

I have a defined an on_change('selected', my_callback) callback for my data table. The callback function has the following signature:

def my_callback(self, attr, old, new):
    ...

However I'm not able to deselect what has been selected after the my_callback handler is called.

I have tried to manipulate the new['1d'] or old['1d'] dictionaries without success.

What is the proper way to deselect rows in a data table and go back to the original state where nothing was selected?

There's a similar question on G-groups but it had no answers. Thanks

like image 573
Carmellose Avatar asked Jul 12 '26 13:07

Carmellose


1 Answers

To deselect DataTable rows programmatically and go back to the original state where nothing was selected, you may use this in python:

source.selected.indices = []

where source is the ColumnDataSource for the DataTable.

like image 91
WebDev Avatar answered Jul 15 '26 01:07

WebDev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!