You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

406
406
407
+
## ComboBox (string values)
408
+
409
+
The `ui.combo_box` component can be used to select from a list of items. It also provides a search field to filter available results. Note that the search behavior differs slightly for different data types.
410
+
- Numeric types - only support exact match
411
+
- Text based data types - support partial search matching
412
+
- Date types support searching by different date parts (e.g. `2024`, `2024-01`, `2024-01-02`, `2024-01-02 00`, `2024-07-06 00:43`, `2024-07-06 00:43:14`, `2024-07-06 00:43:14.247`)
413
+
414
+
Here's a basic example for selecting from a list of string values and displaying the selected key in a text field.
415
+
416
+
```python
417
+
from deephaven import ui
418
+
419
+
420
+
@ui.component
421
+
defui_combo_box():
422
+
value, set_value = ui.use_state("")
423
+
424
+
combo = ui.combo_box(
425
+
"Text 1",
426
+
"Text 2",
427
+
"Text 3",
428
+
label="Text",
429
+
on_selection_change=set_value,
430
+
selected_key=value,
431
+
)
432
+
433
+
text = ui.text("Selection: "+str(value))
434
+
435
+
return combo, text
436
+
437
+
438
+
my_combo_box = ui_combo_box()
439
+
```
440
+
441
+
## ComboBox (item table source)
442
+
443
+
A combo_box can also take an `item_table_source`. It will use the columns specified.
444
+
445
+
```python
446
+
import deephaven.ui as ui
447
+
from deephaven import time_table
448
+
import datetime
449
+
450
+
# Ticking table with initial row count of 200 that adds a row every second
A list view that can be used to create a list of selectable items. Here's a basic example for selecting from a list of string values and displaying the selected key in a text field.
0 commit comments