Coder Social home page Coder Social logo

Comments (6)

arvindr21 avatar arvindr21 commented on September 28, 2024

Hi @szymonzo

1 : Can you post a code sample?

2 : How are you binding the scope to the tree? And can you post the HTML tag code here pls?.

from jstree-directive.

szymonzo avatar szymonzo commented on September 28, 2024
  1. json tree view - this is data in scope. Look at opened state.
    interface tree view - this is what i see.

<js-tree tree-data="scope" tree-model="treeProcess" tree-plugins="checkbox,wholerow,state" tree-events="ready:readyTree;select_node:selectNode;deselect_node:deselectNode;set_state"></js-tree>

from jstree-directive.

arvindr21 avatar arvindr21 commented on September 28, 2024
  1. If all the children are checked, the parent will automatically be selected if the initial state is set to false else.
  2. Can you post the code for $scope.treeProcess function? I mean how are you updating the tree data?

from jstree-directive.

szymonzo avatar szymonzo commented on September 28, 2024
  1. ok i know but why root state is automatic opened? Can we check and close it ?

2 . Tree process is not a function its object node ,like on the screenshot 1 ($scope.treeProcess = data.node). i thought that jsTree handle data changing ($scope.treeProcess)

from jstree-directive.

arvindr21 avatar arvindr21 commented on September 28, 2024

For 1 you can set "opened" : "false" when loading the tree.

For 2 I am assuming that you have an object like

 $scope.treeModel = [{
      "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"
    }];

and later on you are updating the same scope variable. Once you have updated the scope object, the directive will destroy the current tree and create a new one with the new data.

Is this not the case?

from jstree-directive.

arvindr21 avatar arvindr21 commented on September 28, 2024

Closing the issue.

from jstree-directive.

Related Issues (20)

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.