3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
9 Ext.onReady(function() {
10 var SaleRecord = Ext.data.Record.create([
11 {name: 'person', type: 'string'},
12 {name: 'product', type: 'string'},
13 {name: 'city', type: 'string'},
14 {name: 'state', type: 'string'},
15 {name: 'month', type: 'int'},
16 {name: 'quarter', type: 'int'},
17 {name: 'year', type: 'int'},
18 {name: 'quantity', type: 'int'},
19 {name: 'value', type: 'int'}
22 var myStore = new Ext.data.Store({
25 reader: new Ext.data.JsonReader({
31 var pivotGrid = new Ext.grid.PivotGrid({
54 var configPanel = new pivot.ConfigPanel({
59 measures: ['value', 'quantity'],
63 {field: 'product', width: 60, direction: 'ASC'},
64 {field: 'city', width: 80, direction: 'ASC'},
65 {field: 'person', width: 120, direction: 'ASC'}
69 {field: 'year', direction: 'ASC'},
70 {field: 'quarter', direction: 'ASC'}
74 update: function(config) {
75 pivotGrid.leftAxis.setDimensions(config.leftDimensions);
76 pivotGrid.topAxis.setDimensions(config.topDimensions);
78 pivotGrid.setMeasure(config.measure);
79 pivotGrid.setAggregator(config.aggregator);
81 pivotGrid.view.refresh(true);
86 var viewport = new Ext.Viewport({
90 title : 'Ext JS Pivot Grid',