GithubHelp home page GithubHelp logo

jonfu051 / angular-tree-widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexsuleap/angular-tree-widget

0.0 1.0 0.0 473 KB

Angularjs tree control, which does not require jquery.

Home Page: http://AlexSuleap.github.io

License: MIT License

angular-tree-widget's Introduction

Agular Tree Widget

Light AngularJS tree widget control, without jQuery dependency.

ScreenShot

Features

  • Reacts at model changes.
  • Isolated scope.
  • Easy customizable using css.
  • Custom icons[or no icons at all].
  • Multiple selection.
  • Disabled nodes.

Demo

Watch the tree in action on the demo page.

Installation

Download the project.

Load the style and the script in your project:

<script type="text/javascript" src="/angular-tree-widget.min.js"></script>
<link rel="stylesheet" type="text/css" href="/angular-tree-widget.min.css">

Add a dependency to your application module.

angular.module('myApp', ['TreeWidget']);

Add data for the tree

$scope.treeNodes =[{
	name: "Node 1",
        children: [{
            name: "Node 1.1",
            children:[
				{name:"Node 1.1.1"},
				{name: "Node 1.1.2"}]
        }]
	},{
        name: "Node 2",
        children: [
			{name: "Node 2.1"},
			{name: "Node 2.2"}
		]
    }];

Add the tree tag to your application.

<tree nodes='treeNodes'>

Do not forget to add AngularJS, AngularJS.Animate and Angular Recursion references to your project.

Usage

  • set the image property if you want to use a custom image.
  • set the disabled property on true if you want to disable the node selection.
  • set the expanded property on false if you want the node to be collapsed.
  • updating the tree is done by updating the model.
  • options - add the options attribute to the tree tag html<tree nodes='treeNodes' options='options'>:
    • multipleSelect on true: allows the user to select multiple nodes; default value false.
    • showIcon on false: allows the user to hide the icons; default value true; If no images are provided the tree uses the default icons.
    • expandOnClick on true: allow the user the expand/collapse a node by clicking on it's label.
  • events:
    • 'selection-changed': triggered when a node gets selected;
    • 'expanded-state-changed': triggered whenever a node expand state changes.

License

The MIT License.

Copyright โ“’ 2016 Alex Suleap

See LICENSE

angular-tree-widget's People

Contributors

alexsuleap avatar miguelchico avatar ceilino avatar silvae86 avatar loicmahieu avatar

Watchers

Johnny Fu 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.