请问
//树的节点做超级连接。
//加div以及在节点写object="href:http://...".
dojo.require("dojo.widget.TreeLinkExtension");
这一段我试过了为什么没有作用呢。
(一下是我的代码)
********** jsp *************
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="dojo" uri="/struts-dojo-tags"%>
<%
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
%>
<%@ include file="/include/check.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></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">
-->
<dojo:head />
<script type="text/javascript">
function treeNodeSelected(arg) {
alert(arg.source.title + ' selected');
}
dojo.addOnLoad(function() {
var t = dojo.widget.byId('memberAndUsers');
var s = t.selector;
dojo.event.connect(t, 'select', 'treeNodeSelected');
});
</script>
</head>
<body>
<dojo:div cssStyle="border: 1px solid black; background-color:powderblue;padding-top:8px;padding-left:20px">
<script type="text/javascript">
/* <![CDATA[ */
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Tree");
dojo.require("dojo.widget.TreeRPCController");
dojo.require("dojo.widget.TreeLinkExtension");
dojo.require("dojo.widget.TreeSelector");
/* ]]> */
</script>
<div dojoType="TreeRPCController" widgetId="treeController" DNDcontroller="create" RPCUrl="<s:url />"></div>
<div dojoType="Tree" widgetId="memberAndUsers" toggle="fade" controller="treeController">
<div dojoType="TreeNode" title='<s:property value="root.name" />'
widgetId='<s:property value="root.id" />'
isFolder='<s:property value="root.children.length > 0" />'
objectId='<s:property value="root.id" />'>
</div>
</div>
</dojo:div>
</body>
</html>
******** ftl *******
[
<#list wrappers as r>
{ "title": "${r.name}", "isFolder": <#if r.children?size gt 0>true<#else>false</#if>, "id": "${r.id}", "objectId": "${r.id?js_string}" }<#if r_has_next>,</#if>
</#list>
]
回复 更多评论