]>
git.proxmox.com Git - extjs.git/blob - extjs/build/examples/kitchensink/classic/samples/view/pivot/Configurator.js
3 * This example shows how to create a pivot grid and let your end users
7 Ext
.define('KitchenSink.view.pivot.Configurator', {
8 extend
: 'Ext.pivot.Grid',
9 xtype
: 'configurable-pivot-grid',
10 controller
: 'pivotconfig',
13 'KitchenSink.view.pivot.ConfiguratorController',
14 'KitchenSink.store.pivot.Sales',
15 'Ext.pivot.plugin.Configurator'
18 title
: 'Pivot Grid with Configurator plugin',
31 ptype
: 'pivotconfigurator',
32 pluginId
: 'configurator',
33 // It is possible to configure a list of fields that can be used to configure the pivot grid
34 // If no fields list is supplied then all fields from the Store model are fetched automatically
39 dataIndex
: 'quantity',
41 // You can even provide a default aggregator function to be used when this field is dropped
42 // on the agg dimensions
47 renderer: function(v
, meta
){
48 // This field can be dragged onto leftAxis or topAxis.
49 // When added to the topAxis the renderer is used to generate the column text, which
50 // means that only the value is passed to the function.
51 // When added to the leftAxis the renderer is called twice, once to generate the
52 // row labels and once by the grid panel so you can style the cell.
53 // To style an aggregated cell you need to add the renderer to the aggregate dimension.
54 return meta
? v
: Ext
.Date
.monthNames
[v
];
59 // Configure the aggregate dimensions. Multiple dimensions are supported.
66 // Configure the left axis dimensions that will be used to generate the grid rows
77 * Configure the top axis dimensions that will be used to generate the columns.
78 * When columns are generated the aggregate dimensions are also used. If multiple aggregation dimensions
79 * are defined then each top axis result will have in the end a column header with children
80 * columns for each aggregate dimension defined.
88 itemPosition
: 1, // after title before collapse tool
90 ui
: 'default-toolbar',
95 xtype
: 'menucheckitem',
97 checkHandler
: 'changeDock'
116 path
: 'classic/samples/view/pivot/ConfiguratorController.js'
119 path
: 'classic/samples/model/pivot/Sale.js'
122 path
: 'classic/samples/store/pivot/Sales.js'
134 initComponent: function () {
137 me
.width
= me
.profileInfo
.width
;