PDA

View Full Version : [CLOSED] GridPanel columns autosize



lasting
Oct 02, 2014, 11:33 AM
Hello,

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?

Thanks

Daniil
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".
http://examples2.ext.net/#/Getting_Started/Release_Documents/BREAKING_CHANGES/

It might contain some tips what to replace with.

lasting
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.

Daniil
Oct 02, 2014, 3:31 PM
You can also review the ExtJS API docs.
http://docs.sencha.com/extjs/4.2.1/#!/api

There is still the getCell method.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.Table-method-getCell

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.