楼盘width
是像素宽度。
{
xtype: 'grid',
store: store,
selModel: Ext.create('Ext.selection.CheckboxModel', {
mode: 'SINGLE'
}),
layout: 'fit',
columns: [
{
text: "pum",
dataIndex: 'SRD_NAME_FL',
width: 400
}
],
columnLines: true
}
如果我只有一列,我怎样才能使列宽 = 100%
或者如果我有几列 - 如何使最后一列拉伸(stretch)到网格的末尾?
最佳答案
对于 ExtJS3,设置 forceFit
在 GridPanels viewConfig
.见:http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.grid.GridView
对于 ExtJS 4 集 forceFit
直接在 GridPanel 上:http://docs.sencha.com/ext-js/4-0/#/api/-cfg-forceFit并与 flex
结合使用在你的专栏上。
v4 示例
var p = Ext.Create('Ext.grid.Panel',{
forceFit: true,
columns: [{
xtype: 'gridcolumn',
header: _ll.id,
sortable: true,
resizable: false,
flex: 0, //Will not be resized
width: 60,
dataIndex: 'Id'
}, {
xtype: 'gridcolumn',
header: __ll.num,
sortable: true,
resizable: true,
flex: 1,
width: 100,
dataIndex: 'number'
}
});
v3 示例
var p = new Ext.grid.GridPanel({
viewConfig: {
forceFit: true
},
columns: [{
xtype: 'gridcolumn',
header: _ll.id,
sortable: true,
resizable: false,
fixed: true, //Will not be resized
width: 60,
dataIndex: 'Id'
}, {
xtype: 'gridcolumn',
header: __ll.num,
sortable: true,
resizable: true,
width: 100,
dataIndex: 'number'
}
});
关于grid - extjs 网格 - 如何使列宽 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6545719/