前言
上一篇我们已经学习过了删除节点的实现,对于修改节点就简单多了,因为上一篇中已经实现了大部分的代码,这里只需添加一些代码就可以了。
实现
为了改动较少,所以我们不去掉上篇中已经实现的删除的功能,就让修改和删除共存!
代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!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">
<script type="text/javascript" src="${path}/jq/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="${path }/Z-Tree/jquery.ztree.core.js"></script>
<script type="text/javascript" src="${path }/Z-Tree/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="${path }/Z-Tree/jquery.ztree.exedit.js"></script>
<link rel="stylesheet" href="${path}/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<title>Insert title here</title>
</head>
<script>
var zTree;
var selectNode;
var load = false;
$(function(){
zTree = $.fn.zTree.init($("#treeDemo"), setting);
})
var setting = {
async : {
enable : true,
dataType : "text",
type : "post",
url : "${path}/CityNodeServlet?timestamp="