Skip to content

Commit 9fd79b4

Browse files
committed
Add allowCopy documentation
1 parent 4ef7650 commit 9fd79b4

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

api/javascript/ui/grid.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,57 @@ Represents the Kendo UI Grid widget. Inherits from [Widget](/api/javascript/ui/w
1010

1111
## Configuration
1212

13+
### allowCopy `Boolean|Object` *(default: false)*
14+
15+
If set to `true` and selection of the Grid is enabled the user could copy the selection into the clipboard and paste it into Excel or other similar programs that understand TSV/CSV formats. By default allowCopy is disabled and the default format is TSV.
16+
Can be set to a JavaScript object which represents the allowCopy configuration.
17+
18+
#### Example - enable allowCopy
19+
20+
<div id="grid"></div>
21+
<script>
22+
$("#grid").kendoGrid({
23+
selectable: "multiple cell",
24+
allowCopy: true,
25+
columns: [
26+
{ field: "productName" },
27+
{ field: "category" }
28+
],
29+
dataSource: [
30+
{ productName: "Tea", category: "Beverages" },
31+
{ productName: "Coffee", category: "Beverages" },
32+
{ productName: "Ham", category: "Food" },
33+
{ productName: "Bread", category: "Food" }
34+
]
35+
});
36+
</script>
37+
38+
### allowCopy.delimeter `String|Object` *(default: "\t")*
39+
40+
Changes the delimeter between the items on the same row. Use this option if you want to change the default TSV format to CSV - set the delimeter to comma ','.
41+
42+
#### Example - change the clipboard format from default TSV to CSV
43+
44+
<div id="grid"></div>
45+
<script>
46+
$("#grid").kendoGrid({
47+
selectable: "multiple cell",
48+
allowCopy: {
49+
delimeter: ",",
50+
},
51+
columns: [
52+
{ field: "productName" },
53+
{ field: "category" }
54+
],
55+
dataSource: [
56+
{ productName: "Tea", category: "Beverages" },
57+
{ productName: "Coffee", category: "Beverages" },
58+
{ productName: "Ham", category: "Food" },
59+
{ productName: "Bread", category: "Food" }
60+
]
61+
});
62+
</script>
63+
1364
### altRowTemplate `String|Function`
1465

1566
The [template](/api/framework/kendo#methods-template) which renders the alternating table rows. Be default the grid renders a table row (`<tr>`) for every data source item.

0 commit comments

Comments
 (0)