playframework中使用JsTree
来源:互联网 发布:linux at 编辑:程序博客网 时间:2024/05/21 17:18
1.配置
引入jquery.js,jquery.cookie.js,jquery.hotkeys.js,jquery.jstree.js和css文件_docs/syntax/!style.css,_docs/!style.css,_lib/themes/default/style.css
2.树形显示(使用html-data)
<div id="demo1" class="demo">
<ul>
<li id="phtml_1">
<a href="#">Root node 1</a>
<ul>
<li id="phtml_2">
<a href="#">Child node 1</a>
</li>
<li id="phtml_3">
<a href="#">Child node 2</a>
</li>
</ul>
</li>
</ul>
</div>
<script type="text/javascript">
$(function () {
$("#demo1")
.jstree({ "plugins" : ["themes","html_data","ui"],
"ui" : {
"initially_select" : [ "1" ]
},
})
.bind("select_node.jstree", function (event, data) {
})
.delegate("a", "click", function (event, data) {
event.preventDefault();
})
});
</script>
效果如下:
3.使用CRRM进行编辑等操作
使用时,需要在建树时协商crrm,如:
.jstree({ "plugins" : ["themes","html_data","ui", "crrm"]});
操作:
创建新的node-步骤:
(1),加一个按钮
<input type="button" class="button" value="create_1" id="create_1" style="float:left;" />
(2),与树绑定
$("#create_1").click(function () {
$("#demo1").jstree("create");
});
(3),这样就可以创建新的node了
4.右键菜单
使用时,需要在树初始化时,加上contextmenu,如:
.jstree({ "plugins" : ["themes","html_data","ui", "crrm","contextmenu"]});
然后加入
.bind("create_node.jstree", function(event, data) {
alert("创建~" + data);
})
.bind("delete_node.jstree", function(event, data) {
alert('你确定要删除?');
})
.bind("rename_node.jstree", function(event, data) {
alert('你确定要rename?');
});
});
这样就可以对其右键事件进行监听。
- playframework中使用JsTree
- jstree使用
- jsTree使用
- JSTree使用
- 使用playframework连接MySql
- PlayFramework
- playframework
- playframework
- JQuery的JSTree使用
- jstree 使用API
- jstree 简单使用
- jsTree使用记录
- jstree的使用
- Jstree的使用
- jstree使用心得
- jstree使用教程
- jstree 使用简介
- jsTree 使用笔记
- Android开发,你应该知道的
- PHP交叉编译和移植
- Asp.net 加密解密类
- php数据库操作类代码
- 【Unity3D】【NGUI】如何使用新的Event事件
- playframework中使用JsTree
- sublime下用快捷键直接运行cocos2dx项目
- Asp.net 获取服务器信息
- 海康 PTZ HTTP控制
- 程序代码,常量,局部变量,全局变量,在内存中的储存位置
- asp.net Linq 实现分组查询
- clr via C#笔记(2)
- 修改请求日志以网页形式显示
- 关于Oracle数据库优化的几点总结