hoffstadt / hoffstadt/DearPyGui
Add hover state and select state to table row.
- Dominant language
- C++
- Stars
- 15.6k
- Forks
- 783
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Problem: I cant figure out how to make full table row item with hover state and how to program navigation through table rows with keyboard arrows using hover state of row. Also it would be great to connect boolean "checkbox" with selectable row on row selection (not on row hover).
**Describe the solution you'd like**
Add "selectable" and "hoverable"(?) argument to "table_row" and "add_table_row" function and something like "get_selected_rows" "get_hovered_row" with table id as input argument. After that it would be easy to iterate through columns and "get_value" of row/column if needed (in my opinion).
**Describe alternatives you've considered**
`
```
with dpg.table() as tbl_id:
dpg.delete_item(item=tbl_id, children_only=True) # clear table
for field in User._fields:
if field != 'id':
dpg.add_table_column(label=field, parent=tbl_id)
for user in User.objects:
with dpg.table_row(filter_key=f"{user.email}", parent=tbl_id):
with dpg.selectable as selectable_id:
with dpg.hoverable as hover_id:
for field in User._fields:
if field in ("id",):
continue
dpg.add_text(user._data[field])
```
`
```
with dpg.table() as tbl_id:
dpg.delete_item(item=tbl_id, children_only=True)
for field in User._fields:
if field != 'id':
dpg.add_table_column(label=field, parent=tbl_id)
for user in User.objects:
**dpg.add_selectable()**
with dpg.table_row(filter_key=f"{user.email}", parent=tbl_id):
for field in User._fields:
if field in ("id",):
continue
dpg.add_text(user._data[field])
```
`
or
`
```
with dpg.table() as tbl_id:
dpg.delete_item(item=tbl_id, children_only=True)
for field in User._fields:
if field != 'id':
dpg.add_table_column(label=field, parent=tbl_id)
for user in User.objects:
with dpg.table_row(filter_key=f"{user.email}", parent=tbl_id, **selectable=True, hoverable=True ** ):
for field in User._fields:
if field in ("id",):
continue
dpg.add_text(user._data[field])
```
`
**Additional context**
"Hoverable rows" case from bootstrap docs is what i mean: [https://getbootstrap.com/docs/4.0/content/tables/](https://getbootstrap.com/docs/4.0/content/tables/)
Contributor guide
Assessment
This issue has not been assessed yet.