operamasks-tree

operamasks-ui开源组件,基于jquery开发的


<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="ui/om-core.js"></script>
	<script type="text/javascript" src="ui/om-tree.js"></script>
	<link rel="stylesheet" type="text/css" href="css/om-all.css"/>
	<script type="text/javascript">
		var data1 = [{
			"text":"node1",
			"children":[{
				"text":"node11"
			},{
				"text":"node12"
			}]
		 },{
			"text":"node2",
			"expanded":true,
			"children":[{
				"text":"node21",
				"expanded":true,
				"children":[{
					"text":"node211"
				},{
					"text":"node212"
				}]
			},{
				"text":"node22"	
			}]
		},{
			"text":"node3"
		},{
			"text":"node4"
		}];

		var data2 = [{id:"n1",text:"品牌",expanded:true},
		             {id:"n2",text:"运营商",expanded:true},
		             {id:"n11",pid:"n1",text:"三星"},
		             {id:"n12",pid:"n1",text:"诺基亚"},
		             {id:"n13",pid:"n1",text:"摩托罗拉"},
		             {id:"n14",pid:"n1",text:"索尼"},
		             {id:"n21",pid:"n2",text:"移动"},
		             {id:"n22",pid:"n2",text:"联通"},
		             {id:"n23",pid:"n2",text:"电信"},
			     		];
		
		$(function(){
			$('#mytree1').omTree({
				dataSource:data1
			});
			$('#mytree2').omTree({
				dataSource:data2,
				simpleDataModel:true		//简单数据模型
				})
		});
	</script>
  </head>
  
  <body>
    <div id="main">
    	<table>
    		<tr>
    			<td style="color: blue;">常规数据结构</td>
    			<td style="color: blue;">简单数据结构</td>
    		</tr>
    		<tr valign="top">
    			<td width="160"><ul id="mytree1"></ul></td>
    			<td><ul id="mytree2"></ul></td>
    		</tr>
    	</table>
    </div>
  </body>
</html>

效果图:



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值