PDA

View Full Version : automatically adjusting column width in grids



lf282
6 May 2010, 4:07 PM
I would like to have the width of columns in a grid sized automatically to fit the header title and the cell value. Is it possible to do this with ExtJS 3.x?

I have tried to leave out the width property in a ColumnModel configuration, but that just seems to make all columns 100px wide. I have also played with autoFill and forceFit, but neither of those does what I want. I found some references to an autoSizeColumns option in Ext.grid.Grid that sounds like it does exactly what I need, but that is no longer available.

This seems like a pretty common use case, so I apologize if this is covered in the documentation or has previously been discussed in the forums, but I was not able to find much on it. Any pointers in the right direction would be appreciated.