Skip to content

Commit fe65052

Browse files
authored
add multi_selectable option to datatable (bokeh#14524)
1 parent aec1ae6 commit fe65052

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

bokehjs/src/lib/models/widgets/tables/data_table.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ export class DataTableView extends WidgetView {
380380
frozenRow: frozen_row,
381381
frozenBottom: frozen_bottom,
382382
explicitInitialization: false,
383+
multiSelect: this.model.multi_selectable,
383384
}
384385

385386
this.data = new TableDataProvider(this.model.source, this.model.view)
@@ -504,6 +505,7 @@ export namespace DataTable {
504505
scroll_to_selection: p.Property<boolean>
505506
header_row: p.Property<boolean>
506507
row_height: p.Property<number>
508+
multi_selectable: p.Property<boolean>
507509
}
508510
}
509511

@@ -542,6 +544,7 @@ export class DataTable extends TableWidget {
542544
scroll_to_selection: [ Bool, true ],
543545
header_row: [ Bool, true ],
544546
row_height: [ Int, 25 ],
547+
multi_selectable: [ Bool, true ],
545548
}))
546549

547550
this.override<DataTable.Props>({

src/bokeh/models/widgets/tables.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
886886
The height of each row in pixels.
887887
""")
888888

889+
multi_selectable = Bool(True, help="""
890+
Whether multiple rows can be selected.
891+
""")
892+
889893
@staticmethod
890894
def from_data(data, columns=None, formatters={}, **kwargs) -> DataTable:
891895
""" Create a simple table from a pandas dataframe, dictionary or ColumnDataSource.

tests/baselines/defaults.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7526,6 +7526,7 @@
75267526
scroll_to_selection: true,
75277527
header_row: true,
75287528
row_height: 25,
7529+
multi_selectable: true,
75297530
},
75307531
DateEditor: {
75317532
__extends__: "CellEditor",

0 commit comments

Comments
 (0)