-
8 Aug 2012 4:19 AM #1
Recalculate column width for editorgrid using forcefit
Recalculate column width for editorgrid using forcefit
Hi all,
I have an editorgrid where I dynamically add some columns (I used this thread as tutorial: http://www.sencha.com/forum/showthre...ds-and-columns).
For my editorgrid I use forecfit as param for the GridView.
After adding the columns I would need to recalculate the width of the columns. Using the getView().refresh() or the grid.reconfigure(this.store, this.getColumnModel()) methods does not work.
Do you have any ideas how I can solve my problem?
Thanks and best wishes,
Dirk
-
8 Aug 2012 6:25 AM #2
Try doLayout()
Try doLayout()
Hi Dirk1,
Are you tried with grid.getView().refresh(true) passing true parameter ? Also you can try this one -
See - http://docs.sencha.com/ext-js/3-4/#!...method-refreshCode:yourGrid.doLayout();
http://docs.sencha.com/ext-js/3-4/#!...ethod-doLayoutsword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
8 Aug 2012 7:30 AM #3
I would suggest using flex for your columns instead of using the outdated forcefit option.
Scott.
-
8 Aug 2012 11:23 PM #4
Hi sword-it and scottmartin,
thanks for your fast response!
@sword-it: This does not work, what a pitty.
@scottmartin: Is there an example? I cannot find this attribute in the Ext.grid.GridColumn docs but I found it via google in some forum topics where they seem to use flex: 1 for flexible and flex: 0 for fix column widths?! But this does not work in my case, too.
If I comment forcefit: true and set all columns to flex: 1, than the columns in the grid at all do not have the width of the view.
Thanks and best wishes,Code:columns: [ { header: 'Header 1', sortable: true, css: "text-align : left;", tooltip: 'Header 1 Tooltip', dataIndex: 'INDEX_1', flex: 1 } ... ]
Dirk


Reply With Quote