树形菜单tag框架 非树形的点击事件

//这种是平行的三级菜单,不是文件夹式树状菜单

<uitag-core:sidebar collapse="false">
<uitag-core-sidebar:navitems>
<uitag-core-sidebar:navitem icon="fa-desktop" dropdown="true" title="资源分类" current="open">
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" title="网络设备">
<utility:each ajaxurl="${basePath}/tbresource!getResourceTypeJson.json?isNetdevice=1">
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="false" title="${data.text}" url="wlsb/list.jsp?type=${data.value}"/>
</utility:each>
</uitag-core-sidebar:navitem>

<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" title="服务器及存储">
<utility:each ajaxurl="${basePath}/tbresource!getResourceTypeJson.json?isNetdevice=0">
<uitag-core-sidebar:navitem dropdown="false" title="${data.text}" url="fwqjcc/list.jsp?type=${data.value}"/>
</utility:each>
</uitag-core-sidebar:navitem>

<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" title="安全设备">
<utility:each ajaxurl="${basePath}/topsec-asset!queryAssetType.json">
<uitag-core-sidebar:navitem dropdown="false" title="${data.text}" url="aqsb/list.jsp?type=${data.value}"/>
</utility:each>
</uitag-core-sidebar:navitem>

<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" title="机房机柜">
<utility:each ajaxdata="[{value:'jf',text:'机房'},{value:'jg',text:'机柜'}]">
<uitag-core-sidebar:navitem dropdown="false" title="${data.text}" url="jfjg/list.jsp?type=${data.value}"/>
</utility:each>
</uitag-core-sidebar:navitem>

<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="false" title="光纤链路" url="gxll/list.jsp"/>
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="false" title="用户节点" url="yhjd/list.jsp"/>
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="false" title="工程师" url="gcs/list.jsp"/>
</uitag-core-sidebar:navitem>
</uitag-core-sidebar:navitems>
</uitag-core:sidebar>
<!-- 右侧内容区域 -->
<layout:panel id="main-content" floats="right" fixwidth="210">
<iframe id="ListFrame" src="#"></iframe>
</layout:panel>
</layout:panel>

<div id="javascript" class="display-hidden">
<!-- ace scripts -->
<script type="text/javascript" src="${basePath}/resources/styles/ui/ace/js/ace-elements.min.js"></script>
<script type="text/javascript" src="${basePath}/resources/styles/ui/ace/js/ace.min.js"></script>


</div>


//这种是文件夹式树状菜单
<uitag-core:sidebar collapse="false">
<uitag-core-sidebar:navitems>
<uitag-core-sidebar:navitem icon="fa-desktop" dropdown="true" title="工单分类" current="open" root="true">
<system:auth resKey="zwww.gdgl.sjgd">
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" tree="true" title="事件工单" url="sjgd/list.jsp" onclick="onSidebarClick(this)">
<cui:tree id="tree1" data="treedata" onClick="onTreeNodeClick"></cui:tree>
</uitag-core-sidebar:navitem>
</system:auth>
<system:auth resKey="zwww.gdgl.gzgd">
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" tree="true" title="故障工单" url="gzgd/list.jsp" onclick="onSidebarClick(this)">
<cui:tree id="tree2" data="treedata" onClick="onTreeNodeClick"></cui:tree>
</uitag-core-sidebar:navitem>
</system:auth>
<system:auth resKey="zwww.gdgl.gjgd">
<uitag-core-sidebar:navitem icon="fa-caret-right" dropdown="true" tree="true" title="割接工单" url="gjgd/list.jsp" onclick="onSidebarClick(this)">
<cui:tree id="tree3" data="treedata" onClick="onTreeNodeClick"></cui:tree>
</uitag-core-sidebar:navitem>
</system:auth>
</uitag-core-sidebar:navitem>
</uitag-core-sidebar:navitems>
</uitag-core:sidebar>




//在sidebar.tag里面写了非树形的点击事件


<%
/**
* 描述:左侧导航栏
* 作用:
* 作者:chanlong(陈龙)
* 时间:2014-11-13 09:32
* 版本:1.0.2014.11.13
*/
%>
<%@ include file="/WEB-INF/tags/sui/common/include.jsp" %>
<%@ tag language="java" pageEncoding="UTF-8" body-content="scriptless"%>

<%@ attribute name="collapse" type="java.lang.Boolean" description="是否可以伸缩"%>

<jsp:doBody var="pageHTML"/>

<div id="sidebar" class="sidebar responsive">
<script type="text/javascript">
try{
ace.settings.check('sidebar', 'fixed');
ace.settings.sidebar_fixed(true);
}catch(e){}
</script>

${pageHTML}

<c:if test="${collapse}">
<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
</div>
</c:if>

<script type="text/javascript">
try{ace.settings.check('sidebar', 'collapsed')}catch(e){}
</script>

<script type="text/javascript">
// 左侧菜单的点击事件
$("div#sidebar ul.nav-list li a.no-dropdown").click(function(){
ace.sidebar.toggle(this);

var url = $(this).attr("url");
$("#ListFrame").attr("src",url);
});
</script>
</div>

你可能感兴趣的:(tag)