Code Monkey home page Code Monkey logo

jquery-tree's Introduction

About

daredevel's jQuery Tree is a jQuery UI widget that you can use to add advanced features to an html tree built using nested unordered lists.

It's designed to be fast, lightweight, simple to deploy and setup and highly configurable.

Features

  • lightweight (less than 16Kb for minified version)
  • tree manipulation methods
  • collapse/expand (derived from jQuery checkboxtree plugin)
  • advanced checkbox logic (derived from jQuery checkboxtree plugin)
  • support for context menu
  • support for ajax
  • support for drag and drop

Changelog

0.1 (coming soon):

  • initial release

Quickstart

First of all, let's setup plugin initialization into html head section:

<!-- include jQuery and jQueryUI libraries -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css"/>

<!-- include plugin -->
<script type="text/javascript" src="minified/jquery.tree.min.js"></script>
<link rel="stylesheet" type="text/css" href="minified/jquery.tree.min.css" />

<!-- initialize checkboxTree plugin -->
<script type="text/javascript">
    //<!--
    $(document).ready(function() {
        $('#tree').tree({
            /* specify here your options */
        });
    });
//-->
</script>

Now, we can build our tree into html body section:

<div id="tree">
    <ul>
        <li><input type="checkbox"><span>Node 1</span>
            <ul>
                <li><input type="checkbox"><span>Node 1.1</span>
                    <ul>
                        <li><input type="checkbox"><span>Node 1.1.1</span>
                    </ul>
            </ul>
            <ul>
                <li><input type="checkbox"><span>Node 1.2</span>
                    <ul>
                        <li><input type="checkbox"><span>Node 1.2.1</span>
                        <li><input type="checkbox"><span>Node 1.2.2</span>
                        <li><input type="checkbox"><span>Node 1.2.3</span>
                            <ul>
                                <li><input type="checkbox"><span>Node 1.2.3.1</span>
                                <li><input type="checkbox"><span>Node 1.2.3.2</span>
                            </ul>
                        <li><input type="checkbox"><span>Node 1.2.4</span>
                        <li><input type="checkbox"><span>Node 1.2.5</span>
                        <li><input type="checkbox"><span>Node 1.2.6</span>
                    </ul>
            </ul>
        <li><input type="checkbox"><span>Node 2</span>
            <ul>
                <li><input type="checkbox"><span>Node 2.1</span>
                    <ul>
                        <li><input type="checkbox"><span>Node 2.1.1</span>
                    </ul>
                <li><input type="checkbox"><span>Node 2.2</span>
                    <ul>
                        <li><input type="checkbox"><span>Node 2.2.1</span>
                        <li><input type="checkbox"><span>Node 2.2.2</span>
                        <li><input type="checkbox"><span>Node 2.2.3</span>
                            <ul>
                                <li><input type="checkbox"><span>Node 2.2.3.1</span>
                                <li><input type="checkbox"><span>Node 2.2.3.2</span>
                            </ul>
                        <li><input type="checkbox"><span>Node 2.2.4</span>
                        <li><input type="checkbox"><span>Node 2.2.5</span>
                        <li><input type="checkbox"><span>Node 2.2.6</span>
                    </ul>
            </ul>
    </ul>
</div>

Please, refer to documentation for details.

jquery-tree's People

Contributors

valeriogalano avatar

Watchers

Rajan Maharjan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.