View Full Version : [CLOSED] GridPanel columns autosize

Oct 02, 2014, 11:33 AM

I want to have the columns of a gridpanel autosize according to the data inside.

I found a solution on http://forums.ext.net/showthread.php?17270-CLOSED-Dynamic-GridPanel-AutoSize-every-column but it's not working in the new version because there is no getColumnModel method on the grid.

Is there another solution? Or how can this solution be adapted to the new version?


Oct 02, 2014, 12:29 PM
Hi @lasting,

I have not seen a solution for Ext.NET v2. It should be very similar. Just it needs to update the scripts.

Please review this document searching for "getColumnModel".

It might contain some tips what to replace with.

Oct 02, 2014, 2:57 PM
Yes, it shows for
GridPanel1.getColumnModel().columns that it can be accessed using
var headerCt = App.GridPanel1.headerCt;
columns = headerCt.getGridColumns();

But there are some other issues. For example
view.getCell(rowIdx, colIdx), there is no getCell method on the view and I did not find any records of this method on Breaking changes.

Oct 02, 2014, 3:31 PM
You can also review the ExtJS API docs.

There is still the getCell method.

It is private now for some reason (I don't know why) and the parameters have been changed. Though, I would try to use it.