PDA

View Full Version : AutoExpandColumn on Grid reconfigure.



paubach
24 Dec 2009, 3:16 AM
Hi,
I'm trying to reconfigure a grid, but the columns which usually expand to fit all the space don't expand as expected.
When I change anything (size of a column, etc) the grid columns expand to fit all the space.



grid.reconfigure(myStore,myColumns);
grid.getView().refresh();




var myView = new Ext.grid.GroupingView({
forceFit:true,
enableRowBody:true,
emptyText: 'No open incidents',
emptyGroupText: 'This site has not open incidents',
enableGroupingMenu: true,
enableNoGroups: true,
hideGroupedColumn: true,
autoFill: true,
startCollapsed: false,
groupTextTpl: '{[values.text.substr(0,values.text.indexOf(":"))]} : {[(values.text.indexOf("Site")==0)?values.gvalue:values.text.substr(values.text.indexOf(":")+1)]} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})',
showInfo:layOpts.descOn,
getRowClass : function(record, rowIndex, p, store){
if(this.showInfo){
p.body = '<p style="font-size:smaller; font-stretch:narrower; padding-left:5px">'+record.data.desc+'</p>';
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
});




var grid = new Ext.grid.GridPanel({
store: myStore,
colModel: myColumns,
view: myView,
title: '',
tools: [{
id:'info',
handler: function(event, toolEl, panel) {
myView.showInfo = myView.showInfo?false:true;
myView.showInfo?toolEl.setStyle('background-position', '-100px -15px'):toolEl.setStyle('background-position', '-100px 0px');

if(myView.startCollapsed)
{
myView.startCollapsed = false;
myView.refresh();
myView.startCollapsed = true;
}
else
{
myView.refresh();
}
}
},{
id:'full',
handler: function(event, toolEl, panel) {
var supportwindow = window.open('/cgi-bin/bin/webspeed_OE10.pl/osc_incidents','support','width=' + 950 + ',height=' + 550 + ',menubar=no,location=no,resizable=yes,toolbar=no,scrollbars=no,status=no,top='+0+',left='+0);
supportwindow.focus();
}
},{
id:'export',
handler: function(event, toolEl, panel) {
alert('Your download will start shortly\nYour incidents are loading. \n\nYou can keep working without leaving the page.');
document.getElementById('miniFrame').src='/cgi-bin/bin/webspeed_OE10.pl/osc_xls';
}
},{
id:'clear',
handler: function(event, toolEl, panel) {
restoreGrid();
}
}],
layout:'fit',
autoScroll:true,
frame: false,
enableColumnMove:true
});

moegal
6 Mar 2010, 10:15 AM
did you ever get a solution on this?

Marty