admin管理员组文章数量:1328037
var colModel = new Ext.grid.ColumnModel({
columns: [ columns here...]
})
var grid = new Ext.Ext.grid.GridPanel({
store: store,
loadMask: true,
autoExpandColumn: 'itemDescription',
stripeRows: true,
colModel: colModel
})
var form = new Ext.FormPanel({
labelWidth: 150,
bodyStyle: 'padding:2px 5px;',
autoScroll: true,
items:[
new Ext.form.FieldSet({
layout: 'fit',
collapsible: true,
height:300,
items: [
grid
]
}
]
})
The grid does not change its width once the window gets resized... Any thoughts???
var colModel = new Ext.grid.ColumnModel({
columns: [ columns here...]
})
var grid = new Ext.Ext.grid.GridPanel({
store: store,
loadMask: true,
autoExpandColumn: 'itemDescription',
stripeRows: true,
colModel: colModel
})
var form = new Ext.FormPanel({
labelWidth: 150,
bodyStyle: 'padding:2px 5px;',
autoScroll: true,
items:[
new Ext.form.FieldSet({
layout: 'fit',
collapsible: true,
height:300,
items: [
grid
]
}
]
})
The grid does not change its width once the window gets resized... Any thoughts???
Share Improve this question asked Apr 19, 2012 at 6:07 AMemberAMember 3,0572 gold badges34 silver badges64 bronze badges 2-
2
It would help to know the entire container structure and not only that the
Grid
is placed inside aFieldSet
which again is inside aFormPanel
. Are you sure its not theFieldSet
which is not resizing? If you putanchor: '-0'
on theFieldSet
, does that help? – Chau Commented Apr 19, 2012 at 6:17 - you can write it as an answer and I will accept it – AMember Commented Apr 19, 2012 at 7:30
2 Answers
Reset to default 4Your Grid
will resize according to the FieldSet
due to layout: 'fit'
. Since the FormPanel
doesn't have a layout set, it automatically uses layout: 'form'
. The FieldSet
will act as a normal Form Field
and thus needs to be configured to resize it self. This can be done using the anchor
property of the FormLayout
:
var form = new Ext.FormPanel({
labelWidth: 150,
bodyStyle: 'padding:2px 5px;',
autoScroll: true,
items:[
new Ext.form.FieldSet({
layout: 'fit',
anchor: '-0',
collapsible: true,
height:300,
items: [
grid
]
}
]
});
This will tell the FieldSet
to always stay 0 pixels from the right edge of the FormPanel
.
try this.....
var colModel = new Ext.grid.ColumnModel({
columns: [ columns here...]
})
var grid = new Ext.Ext.grid.GridPanel({
store: store,
loadMask: true,
autoExpandColumn: 'itemDescription',
stripeRows: true,
colModel: colModel
})
var form = new Ext.FormPanel({
labelWidth: 150,
bodyStyle: 'padding:2px 5px;',
autoScroll: true,
items : {
xtype : 'fieldset',
title : 'Give proper Title',
defaults: {
anchor: '100%'
},
layout: 'anchor',
collapsible: true,
items: grid
}
});
本文标签:
版权声明:本文标题:javascript - Extjs 3.3.1 FieldSet with layout fit and grid in it does not resize the grid on window resize - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742238691a2438540.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论