将容器的布局设置为form可以解决这个问题。
下面是部分代码:
region:"center",
width:0,
layout:"form",
labelWidth : 35,
style : 'padding:15px 10px 10px 10px',
items : [ {
// width:"70%",
xtype : "combo",
// name : "study",
store : [ "1", "2", "3" ],
emptyText : '请选择...',
fieldLabel : "类型",
anchor : "100%"
}, {
xtype : "combo",
// name : "study",
store : [ "1", "2", "3" ],
emptyText : "请选择...",
fieldLabel : "编号",
anchor : "100%"
}]
本文介绍了一种解决ExtJS中表单布局问题的方法,通过将容器布局设置为form,可以使表单项更好地适应窗口大小。文中提供了一个示例代码片段,展示了如何创建两个下拉框并设置它们占据容器的100%宽度。
2554

被折叠的 条评论
为什么被折叠?



