mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #1005] Help: Is there an example somewheres of a table where you can highlight and select an entire row? #729
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#729
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SimplySeth on GitHub (Jul 12, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1005
Is there an example somewheres of a table where you can highlight and select an entire row?
This is what I'm trying so far:
@rivo commented on GitHub (Aug 4, 2024):
From what I can see, you don't need to call
SetInputCapture(), especially not for each row. Just calltable.SetSelectable(true, false)once when initializing your table. UseSetSelectedFunc()to listen for selections (Enter key). It's all there in the documentation.For an example of this, check out the demo presentation included in the package. The code for selecting rows is here:
github.com/rivo/tview@65571ae51e/demos/presentation/table.go (L311)