]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | *\r | |
3 | * This example shows how to create a pivot grid and display the results in\r | |
4 | * an outline layout.\r | |
5 | *\r | |
6 | */\r | |
7 | Ext.define('KitchenSink.view.pivot.LayoutOutline', {\r | |
8 | extend: 'Ext.pivot.Grid',\r | |
9 | xtype: 'outline-pivot-grid',\r | |
10 | controller: 'pivotlayout',\r | |
11 | \r | |
12 | requires: [\r | |
13 | 'KitchenSink.store.pivot.Sales',\r | |
14 | 'KitchenSink.view.pivot.LayoutController'\r | |
15 | ],\r | |
16 | \r | |
17 | title: 'Outline layout',\r | |
18 | collapsible: true,\r | |
19 | multiSelect: true,\r | |
20 | height: 350,\r | |
21 | \r | |
22 | store: {\r | |
23 | type: 'sales'\r | |
24 | },\r | |
25 | selModel: {\r | |
26 | type: 'rowmodel'\r | |
27 | },\r | |
28 | \r | |
29 | // Set layout type to "outline". If this config is missing then the default layout is "outline"\r | |
30 | viewLayoutType: 'outline',\r | |
31 | \r | |
32 | // Set this to false if multiple dimensions are configured on leftAxis and\r | |
33 | // you want to automatically expand the row groups when calculations are ready.\r | |
34 | startRowGroupsCollapsed: false,\r | |
35 | \r | |
36 | // Configure the aggregate dimensions. Multiple dimensions are supported.\r | |
37 | aggregate: [{\r | |
38 | dataIndex: 'value',\r | |
39 | header: 'Sum of value',\r | |
40 | aggregator: 'sum',\r | |
41 | width: 90\r | |
42 | }],\r | |
43 | \r | |
44 | // Configure the left axis dimensions that will be used to generate the grid rows\r | |
45 | leftAxis: [{\r | |
46 | dataIndex: 'person',\r | |
47 | header: 'Person',\r | |
48 | width: 80\r | |
49 | },{\r | |
50 | dataIndex: 'company',\r | |
51 | header: 'Company',\r | |
52 | sortable: false,\r | |
53 | width: 80\r | |
54 | }],\r | |
55 | \r | |
56 | /**\r | |
57 | * Configure the top axis dimensions that will be used to generate the columns.\r | |
58 | * When columns are generated the aggregate dimensions are also used. If multiple aggregation dimensions\r | |
59 | * are defined then each top axis result will have in the end a column header with children\r | |
60 | * columns for each aggregate dimension defined.\r | |
61 | */\r | |
62 | topAxis: [{\r | |
63 | dataIndex: 'country',\r | |
64 | header: 'Country'\r | |
65 | }],\r | |
66 | \r | |
67 | tbar: [{\r | |
68 | text: 'Collapsing',\r | |
69 | menu: [{\r | |
70 | text: 'Collapse all',\r | |
71 | handler: 'collapseAll'\r | |
72 | },{\r | |
73 | text: 'Expand all',\r | |
74 | handler: 'expandAll'\r | |
75 | }]\r | |
76 | },{\r | |
77 | text: 'Subtotals position',\r | |
78 | menu: {\r | |
79 | defaults: {\r | |
80 | xtype: 'menucheckitem',\r | |
81 | group: 'subtotals',\r | |
82 | checkHandler: 'subtotalsHandler'\r | |
83 | },\r | |
84 | items: [{\r | |
85 | text: 'First',\r | |
86 | checked: true\r | |
87 | },{\r | |
88 | text: 'Last'\r | |
89 | },{\r | |
90 | text: 'None'\r | |
91 | }]\r | |
92 | }\r | |
93 | },{\r | |
94 | text: 'Totals position',\r | |
95 | menu: {\r | |
96 | defaults: {\r | |
97 | xtype: 'menucheckitem',\r | |
98 | group: 'totals',\r | |
99 | checkHandler: 'totalsHandler'\r | |
100 | },\r | |
101 | items: [{\r | |
102 | text: 'First'\r | |
103 | },{\r | |
104 | text: 'Last',\r | |
105 | checked: true\r | |
106 | },{\r | |
107 | text: 'None'\r | |
108 | }]\r | |
109 | }\r | |
110 | }],\r | |
111 | \r | |
112 | //<example>\r | |
113 | otherContent: [{\r | |
114 | type: 'Controller',\r | |
115 | path: 'classic/samples/view/pivot/LayoutController.js'\r | |
116 | },{\r | |
117 | type: 'Model',\r | |
118 | path: 'classic/samples/model/pivot/Sale.js'\r | |
119 | },{\r | |
120 | type: 'Store',\r | |
121 | path: 'classic/samples/store/pivot/Sales.js'\r | |
122 | }],\r | |
123 | profiles: {\r | |
124 | classic: {\r | |
125 | width: 600\r | |
126 | },\r | |
127 | neptune: {\r | |
128 | width: 750\r | |
129 | }\r | |
130 | },\r | |
131 | //</example>\r | |
132 | \r | |
133 | initComponent: function () {\r | |
134 | var me = this;\r | |
135 | \r | |
136 | me.width = me.profileInfo.width;\r | |
137 | \r | |
138 | me.callParent();\r | |
139 | }\r | |
140 | });\r |