Js-easyui初始化树

原创 2013年12月05日 15:45:04
<body>
<jsp:include page="/av/top.jsp"></jsp:include>
<jsp:include page="/av/module/head.jsp"></jsp:include>
<!-- nav -->
<div class="zsnavigation">aa<img src="av/images/erjidhimg.png" />发布aa</div>
<!-- main -->
<div class="zserjimain">
	<div id="leftTree" class="zsermleft" style="overflow-y:auto ;height:480px;width:199px;border:0px solid black;">
		<ul id="mytree" style="height:190px;"> </ul>  
	</div>
	<div id="rightPage" class="zsermright">
		<iframe id="dynaPage" src="<%=request.getContextPath()%>/av/module/knowledge/knowledgePublish/dynaPage.jsp"  frameborder="0"  width="100%" onload="dyniframesize('dynaPage');"></iframe>
	</div>
</div>
<!-- 
<div id="mm" class="easyui-menu" style="width: 120px;">
	<div onclick="MenuWin()" iconcls="icon-add">添加子菜单</div>
	<div onclick="updateMenu()" iconcls="icon-edit">修改</div>
	<div onclick="delMenu()" iconcls="icon-remove">删除</div>
</div>
 -->
<div id="zhsh_foot">© 2013 </div>

<script type="text/javascript">
var baseurl = '<%=request.getContextPath()%>';

$(function(){
 	loadProcessTree();
 	dyniframesizeDiv("leftTree");
 	window.setTimeout("expand()", 400);
});

function loadProcessTree(id){
	$('#mytree').tree({   
		checkbox: false,   
		lines : true,
		method : 'post',
		iconCls: 'icon-catalog',
	    url:'pl/templateClass/getTemplateClassTreeRoot.json?rootId='+(id==undefined||id==""?"KnowledgeTemplateClass":id),  
	    onBeforeExpand:function(node,param){
	    	 $('#mytree').tree('options').url = "pl/templateClass/getChildNodeWithPrivilege.json?parentId=" + node.id ;
	    	 $('#mytree').tree('update', {
	             target: node.target,
	             iconCls: 'icon-file'
	         });
	    },
	    onClick:function(node){
	    	var b = $("#tree").tree('isLeaf',node.target);
	    	//document.getElementById("listTable").src="pl/template/templateListByclassId?tableName="+node.attributes.tableName;
	    	if(b){
	    		getTemplateForPublish(node);
	    	}else{
	    		getIntroductionInfo(node);
	    	}
      	},
      	onContextMenu: function(e, node){  
            e.preventDefault();  
            $('#mytree').tree('select', node.target);  
            $('#mm').menu('show', {  
                left: e.pageX,  
                top: e.pageY  
            });  
        }
	});
}

function getIntroductionInfo(node){
	expand();
	if(node){
		window.frames['dynaPage'].loadIntroduction(node.id);
	}
}
function getTemplateForPublish(node){
	if(node){
		if(node.attributes && node.attributes.tableName){
			var tableName=node.attributes.tableName;
			window.frames['dynaPage'].loadTemplage(tableName);
		}
	}
}

function expand() {
	var node = $('#mytree').tree('getSelected');
	if(node){
		$('#mytree').tree('expand',node.target);
	}else{
		$('#mytree').tree('expandAll');
	}
}
</script>
</body>

 

/**
	 * 
	 * @return Collection 树的根,
	 * @throws Exception
	 */
	@RequestMapping("/getTemplateClassTreeRoot")
	public void getTreeRoot(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String roodId = request.getParameter("rootId");
		List<KmTemplateClass> classList = templateClassService
				.getTreeRoot(roodId);
		List<BmpCatalogTreeModel> resultList = templateClassService
				.getCatalogTreeDataJson(classList);

		ObjectMapper mapper = new ObjectMapper();
		String dataStr = mapper.writeValueAsString(resultList);
		response.getWriter().write(dataStr);
		response.getWriter().flush();
		response.getWriter().close();
	}


 

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

jquery easyui树的简答构造+动态生成js全局变量

jquery easyui树的简答构造: JSP页面 [html] view plaincopy 组织机构: input id="p_orga...

easyui js DWZ文档

  • 2013-02-28 16:13
  • 1.92MB
  • 下载

easyUI 鼠标悬停 扩展js

EasyUI easyloader.js分析

/** * easyloader - jQuery EasyUI * * Licensed under the GPL: *   http://www.gnu.org/licenses/gp...

easyUI所需js及css

  • 2016-03-01 14:06
  • 4.98MB
  • 下载

新手学EasyUi+JS----ComboBox 级联

最近在做一个EasyUi ComboBox的级别联动的效果,相关的内容如下: EasyUI刚接触,JS之前学过,不过在怎么用这方面自己还是个新手,不过现在还在不断的学习,实践出真知,这是...

easyui-lang-zh_CN.js

easyui-lang-zh_CN.js

关于easyui通过href引入外部jsp页面js不执行的说明

前段时间 ,在用tab加载界面的时候,界面里面的js不会执行。今天GodSon在此说明一下原因。
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)