刚开始学习ExtJs,在onReady中渲染组件时,renderTo后面跟的是body中定义的div的id,但却不能显示出效果
刚开始学习ExtJs,在onReady中渲染组件时,renderTo后面跟的是body中定义的div的id,但却不能显示出效果,不知道原因,请高手指点,下面是源码<%@p...
刚开始学习ExtJs,在onReady中渲染组件时,renderTo后面跟的是body中定义的div的id,但却不能显示出效果,不知道原因,请高手指点,下面是源码
<%@ 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 'login.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" type="text/css" href="styles.css">
-->
<link rel="stylesheet" href="ext/resources/css/ext-all.css" type="text/css"></link>
<script type="text/javascript" src="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">
Ext.onReady(function(){
var form=new Ext.form.FormPanel({
title:"表单初始化",
width:300,
autoHeigth:true,
frame:true,
RenderTo:'a',
labelWidth:65,
labelAlign:"right",
defaultType:"textfiled",
items:[{
name:"username",
fieldLabel:"用户名",
width:200
},{
name:"password",
fieldLabel:"密码",
inputType:"password",
width:200
},{
name:"birthday",
fieldLabel:"出生日期",
xtype:"datefield",
format:"Y-m-d",
width:150
},{
name:"setGroup",
fieldLabel:"性别",
xtype:"radiogroup",
width:100,
items:[{
name:"sex",
xtype:"radio",
boxLabel:"男"
inputValue:"男"
},{
name:"sex",
xtype:"radio",
boxLabel:"女",
inputValue:"女"
}]
}]
});
})
</script>
</head>
<body>
This is my JSP page. <br>
<div id="a">asda</div>
</body>
</html>
大家帮帮忙啊 展开
<%@ 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 'login.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" type="text/css" href="styles.css">
-->
<link rel="stylesheet" href="ext/resources/css/ext-all.css" type="text/css"></link>
<script type="text/javascript" src="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">
Ext.onReady(function(){
var form=new Ext.form.FormPanel({
title:"表单初始化",
width:300,
autoHeigth:true,
frame:true,
RenderTo:'a',
labelWidth:65,
labelAlign:"right",
defaultType:"textfiled",
items:[{
name:"username",
fieldLabel:"用户名",
width:200
},{
name:"password",
fieldLabel:"密码",
inputType:"password",
width:200
},{
name:"birthday",
fieldLabel:"出生日期",
xtype:"datefield",
format:"Y-m-d",
width:150
},{
name:"setGroup",
fieldLabel:"性别",
xtype:"radiogroup",
width:100,
items:[{
name:"sex",
xtype:"radio",
boxLabel:"男"
inputValue:"男"
},{
name:"sex",
xtype:"radio",
boxLabel:"女",
inputValue:"女"
}]
}]
});
})
</script>
</head>
<body>
This is my JSP page. <br>
<div id="a">asda</div>
</body>
</html>
大家帮帮忙啊 展开
展开全部
RenderTo要小写renderTo,最好用firebug调试调试看看
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
RenderTo:'a',
应该是renderTo : "a";
是小写的renderTo
通常情况下不需要renderTo。除非你确实需要渲染一个已经存在的DOM节点。
应该是renderTo : "a";
是小写的renderTo
通常情况下不需要renderTo。除非你确实需要渲染一个已经存在的DOM节点。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
RenderTo这个属性我还从来没见过,兄台高明
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
进入我们的网页设计群把,我们群讲这个的额
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询