📄 demo.htm
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JTree示例</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/JTree.css" rel="stylesheet" type="text/css" />
<style>
<!--
.inputText{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
border: 1px solid #999999;
}
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #666666;
}
-->
</style>
<script type="text/javascript" src="includes/function.js"></script>
<script type="text/javascript" src="includes/JTree.js"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="41%" valign="top"><div id="showTree"></div></td>
<td width="59%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td>分类名称:</td>
<td><input name="typeCaption" type="text" class="inputText" id="typeCaption" /></td>
<td>优先级:</td>
<td><input name="PRI" type="text" class="inputText" id="PRI" /></td>
</tr>
<tr>
<td>说明:</td>
<td><input name="explain" type="text" class="inputText" id="explain" /></td>
<td>父类:</td>
<td><input name="parentType" type="text" class="inputText" id="parentType" /></td>
</tr>
<tr>
<td>层次:</td>
<td><input name="level" type="text" class="inputText" id="level" /></td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
<!--
function setValueById(pObjID,pValue){
var obj=document.getElementById(pObjID);
try{
obj.value=pValue;
}catch(e){
alert("控件:"+pObjID+" 不存在,或没有value属性")
}
}
function getNodeAtt(pNode,pAtt){
try{
return pNode.attributes.getNamedItem(pAtt).nodeValue;
}catch(e){
//alert("前台调试错误:\n"+e.message+"\n当前节点不存在: "+pAtt+"这个属性");
}
}
var myTree=new JTree("showTree","vogueType.xml");
myTree.setPicPath("img/")
myTree.onclick=function(){
//alert(myTree.selectNode.parentNode.attributes.getNamedItem("explain").nodeValue);
//alert(myTree.clickItem.level)
setValueById("typeCaption",getNodeAtt(myTree.selectNode,"caption"));
setValueById("parentType",getNodeAtt(myTree.selectNode.parentNode,"caption"));
setValueById("PRI",getNodeAtt(myTree.selectNode,"PRI"));
setValueById("explain",getNodeAtt(myTree.selectNode,"explain"));
setValueById("level",myTree.clickItem.level);
}
myTree.CAPTIONATT="caption";
myTree.create();
-->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -