I am so glad this group exists (just discovered it), as I am having an issue I can’t solve by myself.
Assume I have a DataTable like so:
data = dict(
index = list(range(10)),
x = list(range(10)),
y = list(range(10)),
z = [‘some other data’] * 10
)source1 = ColumnDataSource(data)
columns = [
TableColumn(field=“y”, title=“Y”),
TableColumn(field=“z”, title=“Text”),
]
data_table = DataTable(source=source1, columns=columns, width=400, height=280)
Let’s assume there is something important about row 1, and 5, and therefore these rows should get “selected” by default when the table gets rendered. How would such a feat be accomplished? So far I have tried the following:
1.) On the Python side:
source1.selected[‘1d’].indices = [0, 4]
After the above line is executed, the indices are indeed correctly set. But I am not getting the corresponding rows to get highlighted like they do when I actually click on said rows.
2.) As a CustomJS:
source1[‘selected’][‘1d’].indices = [0, 4]
Again, I see no change in highlighting. Quite apart from that, I don’t know how you would pass in lists into JSCustom because JSCustom only takes Bokeh related items in as “args”.
What can I do to get row highlighting to work? Is that possible at all? I should add I am on Bokeh 12.4 and using Python 3.5.