Extjs2.2布局问题

d442895765 2012-03-07 08:54:02
 

jsp代码
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="ext/resources/css/ext-all.css" type="text/css"> </link>
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript" src="ext/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>

<body>
<div id="test" >
</div>
</body>
</html>


js代码
  

Ext.onReady(function(){
var form=new Ext.form.FormPanel({
title : "学习",
width : 202,
headerAsText: "true",
renderTo : "test",
layout : "form",
labelAlign : "left",
labelPad : 10,

items :[{
layout : "column",
items : [{
layout : "form",
items : [{
xtype : "textfield",
fieldLabel : "姓",
width : 100

}]
},{
layout : "form",
items : [{
xtype : "textfield",
fieldLabel : "名" ,
width : 100

}]
}]
}]



});
})




我看资料 布局是按照column和form布局,为什么,我不管怎么布,得到的样子的都是从上至下的样子
...全文
79 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kui5656 2012-03-08
  • 打赏
  • 举报
回复
还有楼主的代码书写的好好规划下^^
kui5656 2012-03-08
  • 打赏
  • 举报
回复

Ext.onReady(function() {
var form = new Ext.form.FormPanel({
title : "学习",
width : 202,
headerAsText : "true",
renderTo : "test",
layout : "form",
labelAlign : "left",
labelPad : 10,

items : [{
layout : "column", //列的布局
items : [{
columnWidth: .5, //楼主,这个要加上
layout : "form",
items : [{
xtype : "textfield",
fieldLabel : "姓",
width : 100

}]
}, {
columnWidth: .5, //楼主,这个要加上
layout : "form",
items : [{
xtype : "textfield",
fieldLabel : "名",
width : 100

}]
}]
}]

});
})
leefwu 2012-03-08
  • 打赏
  • 举报
回复
代码书写要有格式,否则修改起来很麻烦


Ext.onReady(function(){
var form=new Ext.form.FormPanel({
title: "学习",
width: 202,
headerAsText: "true",
renderTo: "test",
layout: "form",
labelAlign: "left",
labelPad: 10,

items:[
{ layout: "column",
items: [
{ columnWidth: .5, layout: "form",
items: [
{ xtype: "textfield", fieldLabel: "姓", width: 100 }
]
},
{ columnWidth: .5, layout: "form",
items: [
{ xtype: "textfield", fieldLabel: "名", width: 100 }
]
}
]
}
]
});
})

87,989

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧