PDA

View Full Version : Grouped Header Grid Issue



chramer
18 Nov 2011, 6:44 AM
Hi there.. So here is my problem. I took the this example (http://docs.sencha.com/ext-js/4-0/extjs/examples/grid/group-header-grid.html), and I changed the grid this way :


var grid = Ext.create('Ext.grid.Panel', {
store: store,
columnLines: true,
columns: [{
text : 'Company',
flex : 1,
sortable : false,
dataIndex: 'company'
},{
text : 'Second Column',
columns : [{
text : 'second1',
width : 75
},{
text : 'second2',
width : 75
}],
},{
text : 'Third Column',
columns :[{
text: 'Stock Price',
width : 225,
columns: [{
text : 'Price',
width : 75,
sortable : true,
renderer : 'usMoney',
dataIndex: 'price'
}, {
text : 'Change',
width : 75,
sortable : true,
renderer : change,
dataIndex: 'change'
}, {
text : '% Change',
width : 75,
sortable : true,
renderer : pctChange,
dataIndex: 'pctChange'
}]
}, {
text : 'Last Updated',
width : 85,
sortable : true,
renderer : Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'
}]
}],
height: 350,
width: 900,
title: 'Grouped Header Grid',
renderTo: 'grid-example',
viewConfig: {
stripeRows: true
}
});


So I got this (http://dl.dropbox.com/u/14161146/senchaforum/12d1dsdvsd.png)


Also pay attention to the width property of the header "Stock Price" (red colored)!! I knew that it's not allowed to set width property for headers, but if I exclude it I got this (http://dl.dropbox.com/u/14161146/senchaforum/12d1dsdwad.png)


Please help! Am I missing something ?:-/
I also tried with (header&headers) instead of (text&columns)..nothing!
I'm using Ext 4.0.7.
Thanks in advance!=;

superDuke
18 Nov 2011, 9:23 AM
Can't see attachments. Are the individual column widths overriding your setting? Did you include all css files too?



{text : 'Third Column',
columns :[{
text: 'Stock Price',
width : 225,
columns: [{
text : 'Price',
width : 75,
sortable : true,
...

chramer
18 Nov 2011, 10:02 AM
i took the example from Sencha Docs, so I think everything is included. I changed the images, you can take a look now!!

superDuke
18 Nov 2011, 10:17 AM
Strange, not sure what the issue is, but adding a height value seems to fix it:



,{
text : 'Second Column',
columns : [{
text : 'second1',
width : 75,
height: 50
},
....

chramer
18 Nov 2011, 10:34 AM
thanks a lot! but still.. it's a bug.. or an omission!!!

superDuke
18 Nov 2011, 11:03 AM
Yep, a bug. I think this may be related to you issue.

http://www.sencha.com/forum/showthread.php?151718-4.0.7-Bug-in-grid-with-grouped-headers

chramer
18 Nov 2011, 11:08 AM
yep... I posted there a link to this topic :)