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 ...
随机推荐
- 2. KNN和KdTree算法实现
1. K近邻算法(KNN) 2. KNN和KdTree算法实现 1. 前言 KNN一直是一个机器学习入门需要接触的第一个算法,它有着简单,易懂,可操作性强的一些特点.今天我久带领大家先看看sklear ...
- 5. EM算法-高斯混合模型GMM+Lasso
1. EM算法-数学基础 2. EM算法-原理详解 3. EM算法-高斯混合模型GMM 4. EM算法-GMM代码实现 5. EM算法-高斯混合模型+Lasso 1. 前言 前面几篇博文对EM算法和G ...
- 1. 感知机原理(Perceptron)
1. 感知机原理(Perceptron) 2. 感知机(Perceptron)基本形式和对偶形式实现 3. 支持向量机(SVM)拉格朗日对偶性(KKT) 4. 支持向量机(SVM)原理 5. 支持向量 ...
- libXext.so.6: cannot open shared object file:
在64位的centos安装64位的oracle的时候,有时候会出现“libXext.so.6: cannot open shared object file:”的错误. 这个原因主要是oracle在安 ...
- c语言二分法
#include <stdio.h> #include <stdlib.h> int Search(int *a,int key) { ,mid; ; while(low< ...
- C语言 · 色盲的民主
算法提高 色盲的民主 时间限制:1.0s 内存限制:256.0MB 问题描述 n个色盲聚在一起,讨论一块布的颜色.尽管都是色盲,却盲得各不相同.每个人都有自己的主张,争论不休.最终, ...
- [uboot]uboot中am437对应的GPIO配置
修改文件:board/ti/am43xx/mux.c 修改内容:void enable_board_pin_mux(configure_module_pin_mux(d3d4_pin_mux)
- mac安装docker,显示无效的命令
mac安装完docker后,显示无效的命令. 在应用程序中找到docker安装的路径,将该路径写到/etc/paths里面
- Activiti Modeler初探实践
以下内容对实践activiti很有用,不过我用的不是github下载的源码包编译出来的war包,不知道什么原因我打出来的包会有点问题.不过这不重要,换个地方下载来源就行,下载网址: http://dl ...
- docker安装及加速配置
需要centos7版本,内核版本不低于3.10 [root@localhost ~]# uname -r3.10.0-514.el7.x86_64 第一步:更新当前软件:[root@localhost ...