fdehau / tui-rs

Build terminal user interfaces and dashboards using Rust
MIT License
10.84k stars 485 forks source link

Multiple selections in a Table #681

Closed kivimango closed 1 year ago

kivimango commented 1 year ago

Problem

Hello ! I just noticed that i can't select multiple items in a Table, only a single item is allowed.

Solution

Implement code for allowing multiple selection of items in a Table. I see an open PR regarding this problem with List too, the work could be based on that with little modification.

fritzrehde commented 1 year ago

I am working on a project using tui-rs called watchbind. I wanted this exact feature as well, but since the development on tui-rs seems to have halted, I thought I would just create my own version that is not general but tailored to my use-case. You can find the code here. More specifically, the set_lines, get_selected_lines and draw methods are probably most interesting for you there. I thought I would just post this here for other people looking for inspiration. Hope it helps!