jsTree插件的简单的应用
2013-10-01 21:27
375 查看
静态的显示页面:
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMS 后台管理工作平台</title>
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery.jstree.js"></script>
<script language="javascript">
/** 第一种写法
$(function() {
//将menuContainer变成一棵树!
$("#demo").jstree( {
"json_data":{
"data":
[
{
"data":"齐齐哈尔大学",
//第一种给对象添加属性
"attr":{"id":"12","name":"hh"},
"children":["child1","child2"]
}
]
},
"plugins" : [ "themes", "json_data" ]
});
});
**/
//第二种写法,注意是添加attr
$(function() {
//将menuContainer变成一棵树!
$("#demo").jstree( {
"json_data":{
"data":
[
{
"data":{
"title":"大学",
"attr":{"href":"www.baidu.com","target":"_top"}
},
"attr":{"id":"12","name":"hh"},
"children":[
{"data":"教务处"},
{"data":
{
"title":"中主一楼",
"attr":{"href":"www.qida.com"}},
"children":["学籍科","办公室"]
}
]
}
]
},
"plugins" : [ "themes", "json_data" ]
});
});
</script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-size: 12px;
}
-->
</style>
</head>
<body>
<div id="demo">
</div>
</body>
</html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMS 后台管理工作平台</title>
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery.jstree.js"></script>
<script language="javascript">
/** 第一种写法
$(function() {
//将menuContainer变成一棵树!
$("#demo").jstree( {
"json_data":{
"data":
[
{
"data":"齐齐哈尔大学",
//第一种给对象添加属性
"attr":{"id":"12","name":"hh"},
"children":["child1","child2"]
}
]
},
"plugins" : [ "themes", "json_data" ]
});
});
**/
//第二种写法,注意是添加attr
$(function() {
//将menuContainer变成一棵树!
$("#demo").jstree( {
"json_data":{
"data":
[
{
"data":{
"title":"大学",
"attr":{"href":"www.baidu.com","target":"_top"}
},
"attr":{"id":"12","name":"hh"},
"children":[
{"data":"教务处"},
{"data":
{
"title":"中主一楼",
"attr":{"href":"www.qida.com"}},
"children":["学籍科","办公室"]
}
]
}
]
},
"plugins" : [ "themes", "json_data" ]
});
});
</script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-size: 12px;
}
-->
</style>
</head>
<body>
<div id="demo">
</div>
</body>
</html>
相关文章推荐
- jstree 从简单说起Jquery 插件应用说明
- lomboz插件的安装配置及开发简单的应用系统
- jquery分页插件datatables各参数详细说明及简单应用
- jquery 插件ztree的应用------简单的树(tree)
- jquery下jstree简单应用 - v1.0
- jqprint打印插件简单应用
- 利用jstree插件轻松构建树应用
- iTween插件 简单代码应用
- (插件设计与简单应用)php中钩子(hook)的应用示例demo
- 科技优家 2016-12-21 00:47 ▓▓▓▓▓▓ 大致介绍 jQuery Validate 插件为表单提供了强大的验证功能,让客户端表单验证变得更简单,同时提供了大量的定制选项,满足应用
- jquery下jstree简单应用 - v1.0
- jquery插件chosen和select的简单应用
- Laravel应用简单好用的多级联动插件cxSelect
- 【MyBean-开源框架】进行简单的逻辑插件(演示在控制台中应用)
- Jquery简单插件应用
- AgileEAS.NET平台视频会议培训第二辑-简单插件开发应用演练(速度下载)
- 一个简单的Chrome浏览器“清理缓存”插件应用开发
- unity3d Localized Dialogs & Cutscenes 插件简单应用
- 利用$.fn.extend自定义拓展插件(简单应用)
- jsTree简单应用Demo