Selecting text in cells
cellTextSelection lets people drag over cell text to select and copy part of it, as on a web page, instead of selecting a range of cells.
Normally a drag over the cells selects a range, and Ctrl+C copies whole cells. Some grids are mostly read: people want to pick a word or a number out of a cell. With cellTextSelection: true, dragging selects text like on a page and Ctrl+C copies just that text.
createGrid(el, { columns, data, cellTextSelection: true });| Action | With cellTextSelection |
|---|---|
| Drag over cells | Selects text (no cell range) |
| Double-click a word | Selects the word in non-editable cells; editable cells still open the editor |
| Ctrl+C with text selected | Copies the selected text |
| Ctrl+C with nothing selected | Copies the focused cell as usual |
| Click, arrows, Shift+click | Work as usual (Shift+click still selects a range) |