PDA

View Full Version : gridpanel columns not fit ! Why can't fill completely



xialinlin
18 Mar 2014, 6:44 PM
48345




Ext.onReady(function() {

var grid = Ext.create('Ext.grid.Panel', {
//store: store,
loadMask: true,
layout: 'fit',
forceFit: true,
// tbar: me.toolbar,
// bbar: me.bbarPage,





columns: {
items: [
{
text: '????',
style: 'text-align:center',
//columnwidth:.1,
columns: [{
text: '????',
style: 'text-align:center',
//width: 280,
dataIndex: 'appName',
sortable: true
}, {
text: '????',
style: 'text-align:center',
align: 'center',
dataIndex: 'appType',
sortable: true
}]
}],
forceFit: true,
layout:'fit'





}















































});


var base = Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
grid
],
renderTo: Ext.getBody()
});




});

scottmartin
19 Mar 2014, 5:39 AM
Grouping headers shrink wraps the child columns.
If you have no width specified, it will default to 100, hence your group width is 200 for your 2 fields.

Ungrouped columns can be assigned flex: 1 to stretch across.

xialinlin
19 Mar 2014, 5:22 PM
thank you!