PDA

View Full Version : [SOLVED] AutoSizeColumns on initial load



chrishallowell
19 Aug 2009, 1:13 PM
How would I use the plugin Ext.ux.grid.AutoSizeColumns to have the grid auto fit the contents at the initial display of the grid? (IE: I don't want to double click in between all of the column headers manually. I want this done automatically when the grid first displays.)

Here's what I have:



Ext.onReady(function(){


var grid4 =new Ext.grid.GridPanel({

plugins: [new Ext.ux.grid.AutoSizeColumns()],


store: store2,


columns:[
{header:'Site', dataIndex:'SITENUM'},
{header:'SiteStr', dataIndex:'SITESTR'},


{header:'RecNum', dataIndex:'VALUE001'}


],

renderTo: 'example-grid4'





});
});