]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/kitchensink/classic/samples/view/pivot/ExcelExport.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / kitchensink / classic / samples / view / pivot / ExcelExport.js
CommitLineData
6527f429
DM
1/**\r
2 *\r
3 * This example shows how to create a pivot grid and export the results to Excel.\r
4 *\r
5 */\r
6Ext.define('KitchenSink.view.pivot.ExcelExport', {\r
7 extend: 'Ext.pivot.Grid',\r
8 xtype: 'excel-pivot-grid',\r
9 controller: 'pivotexport',\r
10\r
11 requires: [\r
12 'KitchenSink.store.pivot.Sales',\r
13 'Ext.pivot.plugin.Exporter'\r
14 ],\r
15\r
16 title: 'Pivot Grid with Exporter plugin',\r
17 collapsible: true,\r
18 multiSelect: true,\r
19 height: 350,\r
20\r
21 store: {\r
22 type: 'sales'\r
23 },\r
24 selModel: {\r
25 type: 'spreadsheet'\r
26 },\r
27\r
28 plugins: [{\r
29 ptype: 'pivotexporter',\r
30 pluginId: 'exporter'\r
31 }],\r
32\r
33 // Configure the aggregate dimensions. Multiple dimensions are supported.\r
34 aggregate: [{\r
35 dataIndex: 'value',\r
36 header: 'Sum of value',\r
37 aggregator: 'sum'\r
38 }],\r
39\r
40 // Configure the left axis dimensions that will be used to generate the grid rows\r
41 leftAxis: [{\r
42 dataIndex: 'person',\r
43 header: 'Person'\r
44 },{\r
45 dataIndex: 'company',\r
46 header: 'Company',\r
47 sortable: false\r
48 }],\r
49\r
50 /**\r
51 * Configure the top axis dimensions that will be used to generate the columns.\r
52 * When columns are generated the aggregate dimensions are also used. If multiple aggregation dimensions\r
53 * are defined then each top axis result will have in the end a column header with children\r
54 * columns for each aggregate dimension defined.\r
55 */\r
56 topAxis: [{\r
57 dataIndex: 'year',\r
58 header: 'Year'\r
59 }, {\r
60 dataIndex: 'country',\r
61 header: 'Country'\r
62 }],\r
63\r
64 header: {\r
65 itemPosition: 1, // after title before collapse tool\r
66 items: [{\r
67 ui: 'default-toolbar',\r
68 xtype: 'button',\r
69 text: 'Export to Excel',\r
70 handler: 'exportToExcel'\r
71 }]\r
72 },\r
73\r
74 //<example>\r
75 otherContent: [{\r
76 type: 'Controller',\r
77 path: 'classic/samples/view/pivot/ExcelExportController.js'\r
78 },{\r
79 type: 'Model',\r
80 path: 'classic/samples/model/pivot/Sale.js'\r
81 },{\r
82 type: 'Store',\r
83 path: 'classic/samples/store/pivot/Sales.js'\r
84 }],\r
85 profiles: {\r
86 classic: {\r
87 width: 600\r
88 },\r
89 neptune: {\r
90 width: 750\r
91 }\r
92 },\r
93 //</example>\r
94\r
95 initComponent: function () {\r
96 var me = this;\r
97\r
98 me.width = me.profileInfo.width;\r
99\r
100 me.callParent();\r
101 }\r
102});\r