日期:2014-05-16  浏览次数:20334 次

ExtJS的问题请教,为啥我使用的元素每一个都会换行呢?
Ext.onReady(function(){
var form = new Ext.form.FormPanel({
title:'商品查询',
labelSeparator:':',
labelWidth:80,
bodyStyle:'padding:5',
frame:true,
collapsible:true,
height:200,
width:(window.screen.width-230),
renderTo:'form',
items:[
new Ext.form.TextField({
fieldLabel:'商品名称',
id:'pname',
width:(window.screen.width-320)*0.18,
itemCls:'float-left',
clearCls:'allow-float',
selectOnFocus:true,
allowBlank:true
}),
new Ext.form.TextField({
fieldLabel:'生产厂商',
id:'pname2',
width:(window.screen.width-320)*0.18,
itemCls:'float-left',
clearCls:'allow-float',
selectOnFocus:true,
allowBlank:true
}),
new Ext.Button({
text:'开始查询',
itemCls:'float-left',
clearCls:'allow-float'
})
]
});
});
ext?元素换行

------解决方案--------------------
Ext.form.FormPanel 默认是以anchor的方式布局的
你需要根据自己的需求来设置layout
------解决方案--------------------
引用:
Ext.form.FormPanel 默认是以anchor的方式布局的
你需要根据自己的需求来设置layout

对,可以去看一下,extjs布局,你可以使用column,或是absolute,自己定义x和y值