标签:lse cti lis simple contex query head api ztree插件
jQuery的 zTree插件
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@include file="/context/mytags.jsp" %> <!DOCTYPE html > <html> <head> <title>菜单列表</title> <t:base type="jquery"></t:base> <link rel="stylesheet" type="text/css" href="plug-in/ztree/css/metroStyle.css"> <script type="text/javascript" src="plug-in/ztree/js/jquery.ztree.core-3.5.min.js"></script> <script type="text/javascript" src="plug-in/ztree/js/jquery.ztree.excheck-3.5.min.js"></script> <script type="text/javascript"> var setting = { check: { enable: false,// 是否启用复选框 chkboxType: {"Y": "", "N": ""} }, data: { simpleData: { enable: true } }, callback: { onExpand: zTreeOnExpand } }; //加载展开方法 function zTreeOnExpand(event, treeId, treeNode) { var treeNodeFuncId = treeNode.id; $.post( ‘whiteListController.do?getMenuInfo‘, {parentFuncId: treeNodeFuncId}, function (data) { var d = $.parseJSON(data); if (d.success) { var dbDate = eval(d.msg); var tree = $.fn.zTree.getZTreeObj("menuSelect"); if (!treeNode.zAsync) { tree.addNodes(treeNode, dbDate); treeNode.zAsync = true; } else { tree.reAsyncChildNodes(treeNode, "refresh"); } } } ); } //首次进入加载level为1的 $(function () { $.post( ‘whiteListController.do?getMenuInfo‘, function (data) { var d = $.parseJSON(data); if (d.success) { var dbDate = eval(d.msg); $.fn.zTree.init($("#menuSelect"), setting, dbDate); } } ); }); </script> </head> <body style="overflow-y: auto" scroll="no"> <ul id="menuSelect" class="ztree" style="margin-top: 30px;"></ul> </body> </html>
标签:lse cti lis simple contex query head api ztree插件
原文地址:https://www.cnblogs.com/yadongliang/p/11642931.html