Setting Selected Property of ColumnData does not Change Selected Row.
See original GitHub issueTo get the selected rows of a DataTable you access the property source.selected['1d']['indices']
. I tried to set the property so selection is based on code, but it doesn’t work. What other way do I have to set the selected rows (preferably with python not JS) ?
In the example below, based on the documentation, I set the selected row to be equal 3
but the table is not selected in the browser.
from datetime import date
from random import randint
from bokeh.io import output_file, show
from bokeh.layouts import widgetbox
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import DataTable, DateFormatter, TableColumn
output_file("data_table.html")
data = dict(
dates=[date(2014, 3, i + 1) for i in range(10)],
downloads=[randint(0, 100) for i in range(10)],
)
source = ColumnDataSource(data)
columns = [
TableColumn(field="dates", title="Date", formatter=DateFormatter()),
TableColumn(field="downloads", title="Downloads"),
]
data_table = DataTable(source=source, columns=columns, width=400, height=280)
source.selected['1d']['indices'] = [3]
show(widgetbox(data_table))
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Preserve JTable selection across TableModel change
You need to preserve the selection and then re-apply it. First of all you will need to get a list of all the...
Read more >Change the source data for a PivotTable - Microsoft Support
Change the source data · Click select a Use an external data source, and then click Choose Connection. · In the Show drop-down...
Read more >Row Selection - JavaScript Data Grid
Configure row selection with the following properties: rowSelection : Type of row selection, set to either 'single' or 'multiple' to enable selection. 'single' ......
Read more >How to highlight active row and column in Excel - Ablebits
In this tutorial, you will learn 3 different ways to dynamically highlight the row and column of a selected cell in Excel.
Read more >Row Selection - Tabulator
Row selection allows users to select and highlight a number of rows that you can then take action on. This allows rows to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was fixed at some point. Original code with update for
selected.indices
:yields:
@BCoat no worries, we just try to keep the tracker reserved for bugs and feature requests, and leave other questions to the mailing list (or SO, gitter)