ExtJS的renderTo相关问题
<%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><!DO...
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
Ext.onReady(function() {
Ext.BLANK_IMAGE_URL = '/ExtDemo/images/s.gif';
var root = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
var c1 = new Ext.tree.TreeNode({
id:"c1",
url:"/ExtDemo/demo/table.jsp",
//hrefTarget:"_blank",
text:"子节点1"
})
var c2 = new Ext.tree.TreeNode({
id:"c2",
url:"/ExtDemo/demo/tree.jsp",
//hrefTarget:"_blank",
text:"子节点2"
})
root.appendChild(c2);
root.appendChild(c1);
var tree = new Ext.tree.TreePanel({
renderTo:"hello",
root:root,
enableDD : true,
width:200
});
// tree.on("click",function(node,event) {
// Ext.MessageBox.alert("提示","您点击了--"+node.id);
// });
tree.on('click', function(node) { //当我点击某个节点的时候会出发这个事件
if (node.attributes.url != null) { //拆分节点的id,判断是否为二级节点
addtab(node.id, node.attributes.url, node.text); //调用上面对应的方法
}
});
});
</script>
</head>
<body>
<div id="hello"></div>
</body>
</html>
在上面的代码中我不想指定到某个div中,也就是不想用renderTo:"hello",,和<div id="hello"></div>而直接显示在页面可以么?
这个document.create() 具体怎么用,我试了一下好像不行呢 展开
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
Ext.onReady(function() {
Ext.BLANK_IMAGE_URL = '/ExtDemo/images/s.gif';
var root = new Ext.tree.TreeNode({
id:"root",
text:"树的根"
});
var c1 = new Ext.tree.TreeNode({
id:"c1",
url:"/ExtDemo/demo/table.jsp",
//hrefTarget:"_blank",
text:"子节点1"
})
var c2 = new Ext.tree.TreeNode({
id:"c2",
url:"/ExtDemo/demo/tree.jsp",
//hrefTarget:"_blank",
text:"子节点2"
})
root.appendChild(c2);
root.appendChild(c1);
var tree = new Ext.tree.TreePanel({
renderTo:"hello",
root:root,
enableDD : true,
width:200
});
// tree.on("click",function(node,event) {
// Ext.MessageBox.alert("提示","您点击了--"+node.id);
// });
tree.on('click', function(node) { //当我点击某个节点的时候会出发这个事件
if (node.attributes.url != null) { //拆分节点的id,判断是否为二级节点
addtab(node.id, node.attributes.url, node.text); //调用上面对应的方法
}
});
});
</script>
</head>
<body>
<div id="hello"></div>
</body>
</html>
在上面的代码中我不想指定到某个div中,也就是不想用renderTo:"hello",,和<div id="hello"></div>而直接显示在页面可以么?
这个document.create() 具体怎么用,我试了一下好像不行呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询