Example of how to enable copy from table cell
Feature Request
I want to be able to copy cell values from the table to the clipboard.
Description of Problem:
I want to be able to use the perspective table like any other table, including copying values out of a table. This is somewhat possible with the current implementation if you make cells edittable.
Potential Solutions:
Context menu, or click cell to highlight, then Ctrl-C copies the value to the clipboard.
Surprisingly this is an enterprise only feature for ag-grid. https://www.ag-grid.com/javascript-data-grid/clipboard/
You can use the "Select Region" mode to select single cells (or regions obv), which are then copyable in the "Copy" menu:
https://github.com/user-attachments/assets/8f850a82-1848-4971-b844-39fd8bb74c56
This could be more elegant:
- [ ] You are still limited to existing perspective output types e.g.
csv, we can add a truly-single-cell and properly formatted (e.g. significant digits or datetime format) special case for when region selection is a single cell. - [ ]
Ctrl-Cis not enabled by default. We could add a handler for this but it may behave quirkily in your web app due to browser focus rules (e.g. I expect this not to work great in Jupyter). Need to do some research. - [ ] '"Region Select"
should be default instead ofRead-Only` maybe? I'm open to ideas about hwo to make selection modes more discoverable.
I'm open to ideas about hwo to make selection modes more discoverable.
HTML table's native text selection mode is the most discoverable, since perspective data-grid renders an html table why doesn't native text selection work, can it be the default mode if other options need to exist?
EDIT:
Seems like text selection does work in edit mode but only for a single cell, one cannot copy across cells (both horizontally/vertically) like in a normal HTML table:
| A | B | C |
|---|---|---|
| 1 | hello | bye |
| 1 | long string of the text | bye |
| 1 | another text string | bye |