AMe*_*ber 5 javascript extjs extjs3
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
]
}
]
})
Run Code Online (Sandbox Code Playgroud)
一旦窗口调整大小,网格不会改变其宽度...任何想法???
您的意愿Grid
会根据 的原因调整大小。由于没有设置布局,它会自动使用. 它将作为正常的,因此需要配置为自行调整大小。这可以使用以下属性来完成:FieldSet
layout: 'fit'
FormPanel
layout: 'form'
FieldSet
Form Field
anchor
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
]
}
]
});
Run Code Online (Sandbox Code Playgroud)
这将告诉FieldSet
始终与 的右边缘保持 0 像素距离FormPanel
。