Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 3f8bb3e

Browse files
authored
Merge pull request #1341 from zewa666/docs-denypaste
docs: explain denyPaste property
2 parents 312be48 + 1a18acc commit 3f8bb3e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/grid-functionalities/excel-copy-buffer.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,26 @@ this.gridOptions = {
9494
sanitizeDataExport: true
9595
},
9696
};
97-
```
97+
```
98+
99+
### Disable pasting on specific columns
100+
If you want to disable pasting values for specific columns you can deactivate it using the denyPaste property on the Column config.
101+
102+
```typescript
103+
this.columnDefinitions = [
104+
{
105+
id: 'colA', name: 'Col A', field: 'col_a',
106+
formatter: Formatters.bold,
107+
exportWithFormatter: true,
108+
sanitizeDataExport: true,
109+
denyPaste: true // <------------
110+
}
111+
];
112+
```
113+
114+
This will even work in situations where your table copy buffer stretches over disabled cells, by simply skipping them. So for the following config (x = paste disabled; o = paste enabled), pasting a 3 cell stretching table buffer will result in Col A and C being updated but ColB ignoring the paste and keeping its original value
115+
116+
Col A | Col B | Col C \
117+
\---------------------\
118+
&nbsp;&nbsp; o &nbsp;&nbsp; | &nbsp;&nbsp;&nbsp; x &nbsp;&nbsp; | &nbsp;&nbsp;&nbsp; o \
119+
NEW | &nbsp;&nbsp;&nbsp; x &nbsp;&nbsp; | &nbsp;NEW

0 commit comments

Comments
 (0)