@@ -27,6 +27,67 @@ JSZip is part of the Kendo UI distribution and is also available via the Kendo U
27
27
28
28
> If JSZip is not included in the page Kendo UI will raise a runtime exception.
29
29
30
+ ## Using GlobalizeJS
31
+
32
+ When GlobalizeJS is needed, it should be included after the Kendo UI scripts.
33
+
34
+ ## Using RequireJS
35
+
36
+ JSZip doesn't play well with RequireJS by default. However it is possible to make it work. Here is an example:
37
+
38
+ ``` html
39
+ <script src =' https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.16/require.js' ></script >
40
+ <script >
41
+ requirejs .config ({
42
+ paths : {
43
+ jquery : ' http://cdn.kendostatic.com/2014.3.1411/js/jquery.min' ,
44
+ jszip : ' http://cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip' ,
45
+ kendo : ' http://cdn.kendostatic.com/2014.3.1411/js/kendo.all.min'
46
+ },
47
+ shim : {
48
+ " kendo" : {
49
+ deps : [ " jquery" , " jszip" ]
50
+ }
51
+ }
52
+ });
53
+ </script >
54
+ <div id =" example" >
55
+ <div id =" grid" style =" width : 900px " ></div >
56
+ <script >
57
+ require ([ " jszip" , " kendo" ], initApp);
58
+ function initApp (jszip ){
59
+ window .JSZip = jszip;
60
+ $ (" #grid" ).kendoGrid ({
61
+ toolbar: [" excel" ],
62
+ excel: {
63
+ fileName: " Kendo UI Grid Export.xlsx" ,
64
+ proxyURL: " http://demos.telerik.com/kendo-ui/service/export"
65
+ },
66
+ dataSource: {
67
+ type: " odata" ,
68
+ transport: {
69
+ read: " http://demos.telerik.com/kendo-ui/service/Northwind.svc/Products"
70
+ },
71
+ schema: {
72
+ model: {
73
+ fields: {
74
+ ProductName: { type: " string" },
75
+ UnitPrice: { type: " number" }
76
+ }
77
+ }
78
+ },
79
+ pageSize: 7 ,
80
+ },
81
+ columns: [
82
+ { width: 300 , field: " ProductName" , title: " Product Name" },
83
+ { width: 300 , field: " UnitPrice" , title: " Unit Price" }
84
+ ]
85
+ });
86
+ }
87
+ </script >
88
+ </div >
89
+ ```
90
+
30
91
## Browser support
31
92
32
93
Excel generation is available for all [ supported browsers] ( /browsers-support ) . Saving the file needs a server-side proxy for older browser versions.
0 commit comments