PDA

View Full Version : [DUPE-1337] PivotGrid headers not renderer when store created with local data



ExTriqui
17 Dec 2010, 4:23 AM
Ext version tested:

Ext 3.3.1


Adapter used:

ext


css used:

ext-all.css
ux-all.css




Browser versions tested against:

Chromium 10
IE8
FF3 (firebug 1.3.0.10 installed)


Operating System:

Ubuntu 10.10


Description:

The headers won't be renderer at all (cause onDataChange is not fired, and thus refresh(true) is not called either) when the store is created from local data.


Test Case:


/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.onReady(function() {
var customData = {
"rows": [{
"id": 1,
"product": "Ladder",
"city": "London",
"state": "NY",
"quantity": 5568,
"value": 17,
"month": 11,
"quarter": 3,
"year": 2010,
"person": "Jamie Avins"
},
{
"id": 2,
"product": "Spanner",
"city": "San Francisco",
"state": "TX",
"quantity": 7639,
"value": 43,
"month": 4,
"quarter": 3,
"year": 2010,
"person": "Ed Spencer"
}]};

var SaleRecord = Ext.data.Record.create([
{name: 'person', type: 'string'},
{name: 'product', type: 'string'},
{name: 'city', type: 'string'},
{name: 'state', type: 'string'},
{name: 'month', type: 'int'},
{name: 'quarter', type: 'int'},
{name: 'year', type: 'int'},
{name: 'quantity', type: 'int'},
{name: 'value', type: 'int'}
]);

var myStore = new Ext.data.Store({
//url: 'simple.json',
//autoLoad: true,
data = customData,
reader: new Ext.data.JsonReader({
root: 'rows',
idProperty: 'id'
}, SaleRecord)
});

var pivotGrid = new Ext.grid.PivotGrid({
title : 'PivotGrid example',
width : 800,
height : 259,
renderTo : 'docbody',
store : myStore,
aggregator: 'sum',
measure : 'value',

viewConfig: {
title: 'Sales Performance'
},

leftAxis: [
{
width: 80,
dataIndex: 'person'
},
{
width: 90,
dataIndex: 'product'
}
],

topAxis: [
{
dataIndex: 'year'
},
{
dataIndex: 'city'
}
]
});
});


See this URL : http://dev.sencha.com/deploy/dev/examples/pivotgrid/simple.js


Steps to reproduce the problem:

Create a store using the 'data' config option.
Create the simplest PivotGrid possible.


The result that was expected:

PivotGrid is displayed with rowHeaders, colHeaders and the data in the body.


The result that occurs instead:

Only the body is renderer, no rowHeaders, no colHeaders.


Possible fix:

not provided


Workaround:

Call grid.view.refresh(true) manually after grid creation.