jsTree 插件
html代码
<div id="jstree1"></div>
js代码:
<script src="__STATIC__/h5/js/jquery.min.js?v=2.1.4"></script>
<script src="https://static.jstree.com/3.3.5/assets/dist/jstree.min.js"></script>
<script>
$(document).ready(function () {
$('#jstree1').jstree({
'core' : {
"animation" : ,
"check_callback" : true,
'force_text' : true,
"themes" : { "stripes" : true },
'data' : {
//"url" : "//www.jstree.com/fiddle/?lazy",
"url":"{:url('img/imgFolder/jsTree')}",
"dataType" : "json",
"data" : function (node) {
return { "id" : node.id }; }
}
},
"plugins" : [ "contextmenu", "dnd", "search", "state", "types", "wholerow" ]
}); }); function demo_create() {
var ref = $('#jstree1').jstree(true), sel = ref.get_selected();
if(!sel.length) { return false; }
sel = sel[];
sel = ref.create_node(sel, {"type":"file"});
if(sel) {
ref.edit(sel);
}
};
function demo_rename() {
var ref = $('#jstree1').jstree(true),
sel = ref.get_selected();
if(!sel.length) { return false; }
sel = sel[];
ref.edit(sel); };
function demo_delete(){
var ref = $('#jstree1').jstree(true),
sel = ref.get_selected();
if(!sel.length) { return false; }
ref.delete_node(sel); //$("#1").remove();
console.log(sel) ref.set_text(, ''); }
</script>
其中data数据格式
$('#jstree1').jstree({ 'core' : {
'data' : [
{ "id" : "ajson1", "parent" : "#", "text" : "Simple root node" },
{ "id" : "ajson2", "parent" : "#", "text" : "Root node 2" },
{ "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" },
{ "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }
]
} });
jsTree 插件的更多相关文章
- 利用jstree插件轻松构建树应用
最近完成了项目中的一个树状应用,第一次接触了jstree这个插件,总的来说它的官方文档还是比较详细的,但是在使用过程中还是出现了一些问题,下面我就来谈谈这款插件的使用和心得. 首先项目需要构建一棵树, ...
- jsTree插件简介(三)
UI-plugin JSTree的UI插件:用来处理选择.不选和鼠标悬浮树选项的插件. 一.属性包括: 1.select_limit:指定一次可以选中几个节点,默认为-1,表示无限制选中. 2.sel ...
- jquery jstree 插件的使用
最近一个项目 需要用到jstree 这个jQuery插件,就研究了下,做目录树 菜单还是很强大的,下面对经常会用到几个用法做下说明. 1. 首先页面 引用 jquery.jstree 2. html ...
- 【笔记】jstree插件的基本使用
官网地址:https://www.jstree.com/ json返回参数格式:推荐第二种方式 不需要在重新拼接返回格式 不刷新页面重新初始化 jstree时使用:$.jstree.destroy() ...
- jstree 插件的使用笔记(一)
官方:http://www.jstree.com/ 一.节点的描述 官方资料:http://www.jstree.com/docs/json/ 格式一 { id : "string&quo ...
- JQuery 目录树jsTree插件用法
PHP循环构造目录树结构 <ul> <php> function digui($fid,$level){ $class=M("wangpan_class") ...
- jsTree 插件Ajax数据
完整代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta ...
- 基于Metronic的Bootstrap开发框架经验总结(3)--下拉列表Select2插件的使用
在上篇<基于Metronic的Bootstrap开发框架经验总结(2)--列表分页处理和插件JSTree的使用>介绍了数据的分页处理,使用了Bootstrap Paginator插件,另外 ...
- (转)基于Metronic的Bootstrap开发框架经验总结(3)--下拉列表Select2插件的使用
http://www.cnblogs.com/wuhuacong/p/4761637.html 在上篇<基于Metronic的Bootstrap开发框架经验总结(2)--列表分页处理和插件JST ...
随机推荐
- JAVA-JSP内置对象之response对象实现页面跳转
相关资料:<21天学通Java Web开发> response对象 实现页面跳转1.可以通过response对象的sendRedirect()方法设置页面重定向,从而实现页面跳转.2.这种 ...
- WPF视频会议系统资料
Android和C#实现实时视频传输Demo 视频会议及流媒体十大开源项目 WinForm二三事(三)Control.Invoke&Control.BeginInvoke
- Linux kernel 有关 spi 设备树参数解析
一.最近做了一个 spi 设备驱动从板级设备驱动升级到设备树设备驱动,这其中要了解 spi 设备树代码的解析. 二. 设备树配置如下: 503 &spi0 { 504 status = &qu ...
- Python 实现多元线性回归预测
一.二元输入特征线性回归 测试数据为:ex1data2.txt ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ,, ...
- Spring Cloud Sleuth 服务跟踪 将跟踪信息存储到数据库
参见上一篇博客:Spring Cloud Sleuth 服务跟踪 参考:zipkin使用mysql保存数据 主要在跟踪服务上配置: 在数据库创建数据库表:(可不创建,在classpath中添加对应的s ...
- webpack7--css压缩成单独的css文件
先看下下面的图片: 我们可以看到,通过Webpack打包后,默认CSS是通过 内部样式表 写入的.我们如何把压缩后的CSS单独导出为CSS 呢? 1.安装 extract-text-webpack-p ...
- [JS] 动态修改ckPlayer播放器宽度
//设置播放器宽度var play_width=0;$(function(){ play_width = $(window).width() - $(".stu-video-r") ...
- Android学习之ListView使用基础
1.ListView的简单用法 1.1 布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andro ...
- backup & restore On Ubuntu
详见:https://help.ubuntu.com/community/BackupYourSystem/TAR 在 使用Ubuntu之前,相信很多人都有过使用Windows系统的经历.如果你备份过 ...
- 自然语言交流系统 phxnet团队 创新实训 项目博客 (九)
项目技术总结: VoiceToText的具体使用方法: 语音转文本部分是调用的科大讯飞的在线语音,它的激发方式是按键,通过按钮触发开启安卓设备的录音,此部分需要在源码中写入关于安卓权限的要求,来调用安 ...