Clipboard
ReoGrid Web supports copy, cut, paste, and delete operations through standard keyboard shortcuts and a programmatic API.
Keyboard shortcuts
| Shortcut | Operation |
|---|---|
Ctrl+C / ⌘+C | Copy |
Ctrl+X / ⌘+X | Cut |
Ctrl+V / ⌘+V | Paste |
Delete | Clear selection |
ClipboardService API
Execute clipboard operations programmatically through the ClipboardService.
const clipboard = grid.keyboardController.clipboardService;
// Copy
await clipboard.copy();
// Cut
await clipboard.cut();
// Paste from Clipboard API
await clipboard.pasteFromClipboardApi();
// Delete selection
clipboard.delete();
Clipboard formats
Copied or cut data is written to the clipboard in the following formats.
| Format | Description |
|---|---|
TSV (text/plain) | Tab-separated text. Compatible with Excel and text editors |
HTML (text/html) | HTML table with style information. High-quality compatibility with Excel |
Interoperability with external applications
- Excel to ReoGrid — When pasting data copied from Excel, values, styles, and cell merges are preserved.
- ReoGrid to Excel — Copied data can be pasted into Excel in TSV/HTML format.
- Text editors — Data can be exchanged in TSV format.
Notes
- Paste operations require browser Clipboard API permissions.
pasteFromClipboardApi()usesnavigator.clipboard.read(). Some browsers may display a permission dialog to the user.- When pasting via a paste event (
Ctrl+V),pasteFromEvent()is used instead, which does not require permission.