PDA

View Full Version : Help with PIvot Grid...



psm1963
9 Sep 2010, 6:58 PM
The pivot table does not resize rows correctly in a resizeable layout. I tried changing the layout, and it didn't fix the problem. Here is the code:
var pivotGrid = new Ext.grid.PivotGrid({
tbar:[
pivotCombo
],
store : pivotStore,
aggregator: 'sum',
measure : 'ct',
layout : 'fit',
leftAxis: [
{ dataIndex: 'name' },
{ dataIndex: 'category' }
],
topAxis: [
{ dataIndex: 'county' },
{ dataIndex: 'city' }
]
});
var pivotGridPanel = new Ext.Panel({
title : 'Pivot View',
layout:'fit',
items: [pivotGrid]
});

Any help is apprerciated

Condor
9 Sep 2010, 11:11 PM
1. Why are you even using pivotGridPanel? Can't you just give the PivotGrid that title?
2. PivotGrid doesn't have a 'layout' config option. Where you looking for the viewConfig:{forceFit:true} config option?
3. pivotGridPanel (or pivotGrid if you removed it in step 1) will need a fixed height and width. You can:
- Specify a fixed height and width
- Include it in a layout that manages both height and width
- Use a Viewport instead of a Panel.
- Use the FitToParent plugin.

serin
5 Nov 2010, 1:05 AM
Hi Condor,

I have problem with PivotGrids data row height. Pivot grid is fit to container vertically , but data rows didn't change their height:
This is my example:




var pivotGrid = new Ext.grid.PivotGrid({
title :'',
id :'extGrid_' + obj.params.id,
width : 400,
height : 400,
header : false,
renderTo : cont,
store : myStore,
measure : 'average',
viewConfig: {
title: "Monitor"

},
aggregator: function(records, measure) {
var total = 0;

for (var i = 0; i < records.length; i++) {
total += records[i].get(measure);
}
var averageColor = (total == 0 ? naColor : okColor);
total = "<span style='font-weight:bold;color:#"+averageColor+"'>"+total+"</span>";

return total;
},


leftAxis: [ { dataIndex: 'location' },{ dataIndex: 'name' } ],

topAxis: [ { dataIndex: 'date' },{ dataIndex: 'time' } ]
});
pivotGrid.view.refresh(true);


See also attached file.

Best regards
Serine

Screamy
2 Jan 2011, 10:01 AM
This fixed it for me:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">