ztree不显示编辑按钮
<%@ 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"> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <html> <head> <base href="<%=basePath%>"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="<%=basePath%>js/jquery-2.1.1.min.js"></script> <link rel="stylesheet" href="<%=basePath%>ztree/css/demo.css" type="text/css"> <link rel="stylesheet" href="<%=basePath%>ztree/css/zTreeStyle/zTreeStyle.css" type="text/css"> <script type="text/javascript" src="<%=basePath%>ztree/js/jquery.ztree.core-3.5.js"></script> <title>Insert title here</title> <script type="text/javascript"> var setting = { edit: { enable: true, showRemoveBtn: true }, data: { simpleData: { enable: true, idKey: "id", pIdKey: "pid", rootPId: 0 } }, callback: { beforeRemove: zTreeBeforeRemove } }; var zNodes; $(function(){ $("#showtree").click(function(){ $.ajax({ type: "POST", url: "<%=basePath%>food/list", data: "", success: function(msg){ zNodes =msg; $.fn.zTree.init($("#treeDemo"), setting, zNodes); } }); }); }) function zTreeBeforeRemove(treeId, treeNode){ alert(treeId); } </script> </head> <body> <input type="button" value="显示树" id="showtree"> <div class="zTreeDemoBackground left"> <ul id="treeDemo" class="ztree"></ul> </div> </body></html>
树显示正确,但是不显示编辑按钮,很奇怪,到底是哪里出了问题了呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的呢。我才知道是拓展的,所以要加入js。
没有加载exedit 部分的js