0

Here is my jsfidder: Demo.

I'm trying to use the AngularJS Treeview and it's the official demo .

<div
  data-angular-treeview="true"
  data-tree-model="data"
  data-node-id="value"
  data-node-label="value.artifactId"
  data-node-children="children" >
</div>

I want to set the node name with the data in value. For example, the name of node

"value": {artifactId": "mock", "groupId": "com.myproject", "scope": "compile", "type": "jar", "version": "0.0.1-SNAPSHOT"} should be mock.0.0.1-SNAPSHOT . I want to know how to set the value of the data-node-label.

1 Answer 1

1

Can you change the feeding JSON format as below.
I have taken only few records just to show the syntax.

{
    "roleName" : "sts.api", 
    "roleId" : "com.myproject.sts", 
    "scope": "compile",
    "type": "jar",
    "version": "0.0.7-SNAPSHOT",
    "children" : []
},  
{
    "roleName" : "simbacall.api", 
    "roleId" : "com.myproject.simba", 
    "scope": "compile",
    "type": "jar",
    "version": "1.1.0.0-SNAPSHOT"
    "children" : [
        {
            "roleName" : "javax.ws.rs-api", 
            "roleId" : "javax.ws.rs", 
            "scope": "compile",
            "type": "jar",
            "version": "2.0",
            "children" : []
        },
        {
        },
        ...
    ]
Sign up to request clarification or add additional context in comments.

1 Comment

The problem is that I can not change the JSON format, so I want to know how to fix this with the current format...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.