Code Monkey home page Code Monkey logo

angular.treeview's People

Contributors

eu81273 avatar igniteflow avatar mmarzouki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular.treeview's Issues

De facto jQuery dependency

At line 63, the directive calls element.empty().:

62: //Rendering template.
63: element.empty().html( $compile( template )( scope ) );

This function isn't supplied as part of jqLite. This means that jquery needs to be included in order to use the directive.

Proposed fixes:

  1. Use another technique to clear the DOM children before re-compiling, or
  2. Update the documentation to explicitly state the dependency.

Does this directive allow multiple selection

I am implementing a tree structure that the user can select more the one node using the Ctrl button.

Is this possible in this directive? Or is there a way I can implement it

Click but no response

I setup the tree using the example given. A simple tree structure:
$scope.folderTreeList = [{ name: "folder_1", label: "Folder 1", collapsed: true, child: [{ name: "file_1", label: "Superman.txt" }] }, { name: "folder_2", label: "Folder 2" }];

The tree able to render correctly. But when I clicked on the folder icon, it won't expand. No error thrown in my firebug. Is a simple setup. But not working. The demo in jsfiddle working fine.

Issue when used in conjunction with ng-include

I've tried to insert the treeview in a partial which I include using ng-include. When a node gets selected
$scope.$watch('tree.currentNode', function() { //...}); does not fire. Neither does
$scope.$parent.$watch('tree.currentNode', function() { //...}); work.
I'd suggest to send an event for this.

Support for check boxes in the tree

Nice directive. But for my project I need to have check boxes in the tree structure because of this I am unable to use this. Could you please let us know by when you are planning to release check boxes feature to your module?

How do I add node image ?

In my project, the node images are vary depend on the node value. If the child element has pdf files then the main node folder icon should be a pdf. Now I can change it via css but how do i make dynamic ?

Does this directive supports in place editing ?

Hello,
Is there a provision that angular.treeview supports editing in place ?

Currently i am using this directive , but also need to edit data present in it. Is it possible , if so please let me know.

Thanks.

Move template string in directive to html file (enhancement)

Is it possible to move the template string used in the directive for the treeview to an external html file?
I'm trying to do this myself but running into some trouble. So far I've moved the attrs variables to scope and my html looks like this:

<ul>
    <li data-ng-repeat="node in treeModel">
        <i class="collapsed"
            data-ng-show="node.nodeChildren.length && node.collapsed"
            data-ng-click="selectNodeHead(node)">
        </i>
        <i class="expanded"
            data-ng-show="node.nodeChildren.length && !node.collapsed"
            data-ng-click="selectNodeHead(node)">
        </i>
        <i class="normal"
            data-ng-hide="node.nodeChildren.length">
        </i>
        <span class="treenode node.nodeType"
            id="node.nodeId"
            data-ng-class="node.selected"
            data-ng-click="selectNodeLabel(node)">
            {{node.nodeLabel}}
        </span>
        <div data-ng-hide="!node.collapsed"
            data-tree-model="node.nodeChildren"
            data-node-id="nodeId"
            data-node-label="nodeLabel"
            data-node-children="nodeChildren"
        </div>
    </li>
</ul>

I had to take the treeId out, and the treeModel is being treated as string, I'm not sure why. Any help or comments would be appreciated.

Tree view programmatically Selected item does not scrolled into view

I am using anjular treeview. I kept this controll inside the div and i set both scroll bar to navigate the tree view node from top to bottom.

Requirement is that Select/Focus the tree view node when ng grid cell is clicked based on validation. As per the requirement corresponding Tree view node is selected once grid cell is clicked.

Problem is that if selected tree view node is not in visible area, user have to manually scroll the div where Tree view have been kept to view Selected/Focused tree view node.

I want to programmatically scroll the tree view to view the focused node.

How to differentiate file node and empty folder node?

I met a problem when using angular treeview, if there are child nodes, the node will show as a folder, this is right. But if node is a directory, but there is no files in this folder, when I use this control, it treats the empty folder as a file. I think this is weird.

I also tried angular tree control, is has a place to set "What is leaf", but in treeview I didn't find the place to set my own way to judge what is a trache and what is a leaf node.

How to add link to files?

When i click on the file in treeview then i want that some other html page should open. So i want to add link to each file(childnode) in json itself and the use it in html page?

Compatibility with filters and databases

When I pull the data from the DB, I get a flat array:

[... : {parent : , children: [, ... ] ...]

Not a recursive structure. This also works great for pagination, filtering and lazy loading.

Generally I'm highly confused by the choice to represent data as a json deeply nested structure.

Is there any way to alleviate this?

Ability to sort data

It would be great to have the ability to easily sort the data, and child data in different ways.

Right click on node

Hello there,

How do I capture a right click event? I want to popup a menu on node right clicking, how do I do that? any suggestions?

thank you.

[enhancement] Add missing bower.json.

Hey, maintainer(s) of eu81273/angular.treeview!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library eu81273/angular.treeview is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "eu81273/angular.treeview",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Some improvements suggestions

hi,
this is really cook and i am using it, thank you :)

but may i suggest some features

  • ability to drag and drop
  • lazy load children for performance
  • check box integration
    -animation

thanks in advanced.

Collapse tree using button

Hi,
Can someone tell me, what is the nicer way to collapse the tree (each node) on button click?

For now I'm using something like:

$scope.collapseTree = function(){
    $scope.nodeList.forEach(function (node){
         node.expanded = false;
    });
};

But I am not sure if this is the best option.
Thanks,
Kamila

Fiddle example missing tree id

The example on the fiddle is missing the tree id attribute. Also, it seems that it's using an older version of the module. Upgrading it would be awesome.

Selected Node

Hi, I'm trying to use watch in controller to know what node is selected, but it is not working, is there any example?

Thanks

Behave icon and span similarly

Hello,

I would like to ask how can I make span (text) to expand/collapse as the icon on click.

The same behavior on-click like icon to collapse or expand if it is a folder

Many thanks

angular.treeview

How to change the icon of the child nodes using angular.treeview?

Use controller to select a Node

How can i use a controller to select a Node (instead of clicking to select)?

I tried to set currentNode and hoped that it will trigger $scope.$watch,
but it does not.

Custom template

I want add some custom buttons in node. For example, i want add delete button on selected node. So, i need custom templating or patch your js with something like

...
'<i class="glyphicon glyphicon-remove" data-ng-show="node.selected" data-ng-click="removeItem(node)"></i>' 
...

Is it possible to add ability to inject template?

any idea how to solve this

hi,
I have an issue where I use Angular tabs and I need to add your tree.view (both using li/ul....)
this is the outcome (see image).

angulartree

Persist the state of the tree and open the tree when coming from other pages.

Hi
I have a requirement where I want to maintain the state of the tree. I mean I want to save/check which nodes are expanded by the user. After expanding the nodes of the tree, user can move to other pages of the application. When user comes back to the tree page, the tree should be expanded by default to the last saved state. How can we achieve this here? If anyone of you have any idea, please guide me. Thanks a lot for reading this and giving your time.

Complete Hierarchy from selected node

Hi, I want to show breadcrumbs when node is selected,but can't get complete hierarchy from selected node
for eg: if i select node subuser2-1-1 then i want
User->subUser2->subuser2-1->subuser2-1-1

Any suggestions??

remove node

Hello,
There is an easy to way to remove a node from the tree?
Thank you.

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.