All Projects → linjingming → sim-tree

linjingming / sim-tree

Licence: MIT license
一个操作简单的基于jquery的树展示插件,支持异步展示子节点

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to sim-tree

Parallaxie
Easiest, Responsive and Customizable Parallax jQuery Plugin
Stars: ✭ 65 (+195.45%)
Mutual labels:  jquery-plugin
jQuery-Sakura
Make it rain - sakura petals or anything else for that matter.
Stars: ✭ 76 (+245.45%)
Mutual labels:  jquery-plugin
floating-scroll
Lightweight jQuery plugin providing floating scrollbar functionality
Stars: ✭ 72 (+227.27%)
Mutual labels:  jquery-plugin
jquery.pwstrength
A jQuery plugin to indicate the strength of passwords
Stars: ✭ 22 (+0%)
Mutual labels:  jquery-plugin
Ace-Responsive-Menu
Ace responsive menu is a lightweight jQuery plugin to create responsive multi-level navigation menus with multi device support. Ace responsive menu comes with 3 variants like horizontal, vertical and accordion menu. It gives complete responsive menu solution for any kind of websites or admin templates. The plugin has clean and well commented val…
Stars: ✭ 46 (+109.09%)
Mutual labels:  jquery-plugin
drawer
A touch-enabled drawer component for the modern web.
Stars: ✭ 26 (+18.18%)
Mutual labels:  jquery-plugin
conditionize.js
Small jQuery plugins for handling conditional form fields via data attributes. Unmaintained.
Stars: ✭ 56 (+154.55%)
Mutual labels:  jquery-plugin
jquery.youtube-inview-autoplay
📺 A jQuery plugin that starts playing YouTube video when it's scrolled into the view and stops it when it's scrolled out
Stars: ✭ 13 (-40.91%)
Mutual labels:  jquery-plugin
valida
jQuery Plugin for client side easy form validations.
Stars: ✭ 17 (-22.73%)
Mutual labels:  jquery-plugin
Accordion.JS
Accordion.JS: Free jQuery Accordion plugin
Stars: ✭ 34 (+54.55%)
Mutual labels:  jquery-plugin
desoslide
Take control of your slideshow with this powerful jQuery plugin
Stars: ✭ 68 (+209.09%)
Mutual labels:  jquery-plugin
jQuery-Awesome-Sosmed-Share-Button
Awesome Social Media Share Button With Share Count
Stars: ✭ 58 (+163.64%)
Mutual labels:  jquery-plugin
blog
仿照nswbmw的N-blog项目写的多人博客系统,引入了bootstrap和jquery validation plugin。详见wiki部分。
Stars: ✭ 10 (-54.55%)
Mutual labels:  jquery-plugin
fontIconPicker
A lightweight iconpicker for use with jQuery
Stars: ✭ 30 (+36.36%)
Mutual labels:  jquery-plugin
xGallerify
A lightweight, responsive, smart gallery based on jQuery
Stars: ✭ 52 (+136.36%)
Mutual labels:  jquery-plugin
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (+4.55%)
Mutual labels:  jquery-plugin
Zebra Tooltips
A lightweight, accessible, and highly configurable jQuery plugin for creating beautiful tooltips
Stars: ✭ 52 (+136.36%)
Mutual labels:  jquery-plugin
jquery.selectlistactions.js
jQuery.SelectListActions plugin allows you to perform several actions with HTML Select lists
Stars: ✭ 35 (+59.09%)
Mutual labels:  jquery-plugin
jquery.throwable
JQuery plugin to make HTML elements throwable
Stars: ✭ 69 (+213.64%)
Mutual labels:  jquery-plugin
Persian-DatePicker
jQuery UI Datepicker with bootstrap theme (Persian Shamsi, Arabic, Gregorian Calendar Support)
Stars: ✭ 36 (+63.64%)
Mutual labels:  jquery-plugin

sim-tree

一个操作简单的基于jquery写的树展示插件,支持异步展示子节点

没有那么多复杂功能,回归简单

npm直接安装

npm install sim-tree --save

简单使用

引入dist目录下的simTree.css 和simTree.js

demo图片

    <div id="tree"></div>
    <div id="tree2"></div>
    // 数据格式1 有children
    var list = [{
        "id": '350102000000',
        "pid": '',
        "name": "鼓楼区",
        "children": [
            {
                "id": '350103000000',
                "pid": '350102000000',
                "name": "东街口"
            }
        ]
    },
    {
        "id": '350103000000',
        "pid": '',
        "name": "台江区"
    },
    {
        "id": '350104000000',
        "pid": '',
        "name": "仓山区"
    }];
    // 数据格式2 同级
    var list = [{
        "id": '350102000000',
        "pid": '',
        "name": "鼓楼区",
    },
    {
        "id": '350103000000',
        "pid": '350102000000',
        "name": "东街口"
    },
    {
        "id": '350103000000',
        "pid": '350101000000',
        "name": "宝龙"
    },
    {
        "id": '350103000000',
        "pid": '',
        "name": "台江区"
    },
    {
        "id": '350104000000',
        "pid": '',
        "name": "仓山区"
    }];
    // 写法1
    var tree = simTree({
        el: '#tree',
        data: list,
        //check: true, // true 开启多选
        //linkParent: true, // 父子关联
        // 点击节点触发
        onClick: function (item) {
            console.log(item);
        },
        // 改变节点触发
        onChange: function (item) {
            console.log(item);
        },
        // 树生成后触发
        done: function (data) {

        }
    });
    // 绑定事件也可以这样写
    tree.on('click', function (item) {
        console.log(item);
    });
    // 改变节点触发
    tree.on('change', function (item) {
        console.log(item);
    });
    // 树生成后触发
    tree.on('done', function (item) {
        console.log(item);
    });
    // 写法2
    var tree2 = $('#tree2').simTree({
        data: list,
        //check: true, // true 开启多选
        //linkParent: true, // 父子关联
        // 点击节点触发
        onClick: function (item) {
            console.log(item);
        },
        // 改变节点触发
        onChange: function (item) {
            console.log(item);
        },
        // 树生成后触发
        done: function (data) {

        }
    });

简单说明文档

交流 & 提问

todo

  • 下拉树

关于作者

  • linjingming
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].