]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/kitchensink/classic/samples/view/pivot/DrillDown.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / kitchensink / classic / samples / view / pivot / DrillDown.js
CommitLineData
6527f429
DM
1/**\r
2 *\r
3 * This example shows how to create a pivot grid and drill down the results.\r
4 *\r
5 * DblClick a cell to open the drill down window and see all records used to\r
6 * aggregate that cell.\r
7 *\r
8 */\r
9Ext.define('KitchenSink.view.pivot.DrillDown', {\r
10 extend: 'Ext.pivot.Grid',\r
11 xtype: 'drilldown-pivot-grid',\r
12\r
13 requires: [\r
14 'KitchenSink.store.pivot.Sales',\r
15 'Ext.pivot.plugin.DrillDown'\r
16 ],\r
17\r
18 title: 'Pivot Grid with DrillDown plugin',\r
19 collapsible: true,\r
20 multiSelect: true,\r
21 height: 350,\r
22\r
23 store: {\r
24 type: 'sales'\r
25 },\r
26 selModel: {\r
27 type: 'spreadsheet'\r
28 },\r
29\r
30 plugins: [{\r
31 ptype: 'pivotdrilldown'\r
32 }],\r
33\r
34 // Configure the aggregate dimensions. Multiple dimensions are supported.\r
35 aggregate: [{\r
36 dataIndex: 'value',\r
37 header: 'Sum of value',\r
38 aggregator: 'sum',\r
39 width: 85\r
40 }],\r
41\r
42 // Configure the left axis dimensions that will be used to generate the grid rows\r
43 leftAxis: [{\r
44 dataIndex: 'company',\r
45 header: 'Company'\r
46 },{\r
47 dataIndex: 'country',\r
48 header: 'Country',\r
49 direction: 'DESC'\r
50 }],\r
51\r
52 /**\r
53 * Configure the top axis dimensions that will be used to generate the columns.\r
54 * When columns are generated the aggregate dimensions are also used. If multiple aggregation dimensions\r
55 * are defined then each top axis result will have in the end a column header with children\r
56 * columns for each aggregate dimension defined.\r
57 */\r
58 topAxis: [{\r
59 dataIndex: 'year',\r
60 header: 'Year'\r
61 }, {\r
62 dataIndex: 'month',\r
63 header: 'Month',\r
64 renderer: function(v){ return Ext.Date.monthNames[v]; }\r
65 }],\r
66\r
67 //<example>\r
68 otherContent: [{\r
69 type: 'Model',\r
70 path: 'classic/samples/model/pivot/Sale.js'\r
71 },{\r
72 type: 'Store',\r
73 path: 'classic/samples/store/pivot/Sales.js'\r
74 }],\r
75 profiles: {\r
76 classic: {\r
77 width: 600\r
78 },\r
79 neptune: {\r
80 width: 750\r
81 }\r
82 },\r
83 //</example>\r
84\r
85 initComponent: function () {\r
86 var me = this;\r
87\r
88 me.width = me.profileInfo.width;\r
89\r
90 me.callParent();\r
91 }\r
92});\r