Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:12:41+00:00 2026-06-14T02:12:41+00:00

So I want to create a Tree with kendo UI treeview item and bind

  • 0

So I want to create a Tree with kendo UI treeview item and bind it to a remote Hierarchical Data Source being a JSON file.

I want the resulting tree to be something like:

(Vehicles)

–(Cars)

—-FM-1100

—-FM-4200

–(Bikes)

—-FM-3100

(Personnel)

–(Clients)

—-GH-3000

–(VIPs)

—-GH-3100

PS. Names in () are supposed to be something like folders containing their “children”

I’ve checked the documentation about all the above in the kendo ui website but I’m a bit confused with the whole callback function the treeview uses to load the deeper stages everytime you expand an item in the tree..

Let’s take the example in kendo documentation for instance:

var homogeneous = new kendo.data.HierarchicalDataSource({
transport: {
    read: {
        url: "http://demos.kendoui.com/service/Employees",
        dataType: "json"
    }
},
schema: {
    model: {
        id: "EmployeeId",
        hasChildren: "HasEmployees"
    }
}
});

$("#treeview").kendoTreeView({dataSource: homogeneous});

JSON sample data:

    {
"employees": [
{"EmployeeId":2,"FullName":"Andrew Fuller","HasEmployees":true,"ReportsTo":null},
{"EmployeeId":3,"FullName":"Carl Jenkins","HasEmployees":true,"ReportsTo":null},
{"EmployeeId":4,"FullName":"Aston Miller","HasEmployees":false,"ReportsTo":2},
{"EmployeeId":5,"FullName":"Damon Sherbands","HasEmployees":false,"ReportsTo":2},
{"EmployeeId":6,"FullName":"Dariel Hanks","HasEmployees":true,"ReportsTo":null},
{"EmployeeId":7,"FullName":"Jason Jackson","HasEmployees":false,"ReportsTo":3},
{"EmployeeId":8,"FullName":"Reylen Scribbs","HasEmployees":false,"ReportsTo":6}
]
}

So,I have to setup a rest server on “http://demos.kendoui.com/service/Employees” that accepts a GET from the tree which provides the “EmployeeId” and then does a search inside the file and returns those who “ReportTo” the “EmployeeId” recieved…??
And what happens the firt time the tree wants to show the initial nodes?

Something like:

@Path("/Employees")
@GET
@Produces(MediaType.TEXT_HTML)
public String returnEmployees(@QueryParam("EmployeeId") int accID) {
    //search the employees.json
    return "<head></head><body><pre>" + searchResultsString + "</pre></body>";
}

How do I search efficiently a JSON file and return all the results in a String?
Or if all these are wrong can someone help me understanding all the GET and the callback stuff?Maybe it does have to do with jsonp I’ve heard about?A bit lost here..

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:12:42+00:00Added an answer on June 14, 2026 at 2:12 am

    Are you able to create a JSON file with the following structure (similar to what you propose in XML format)?

    [
        {
            "id"   :100,
            "text" :"tree",
            "items":[
                {
                    "id"   :1,
                    "text" :"Vehicle",
                    "items":[
                        {
                            "id"   :2,
                            "text" :"Cars",
                            "items":[
                                {
                                    "id"  :3,
                                    "text":"FM-1100"
                                },
                                {
                                    "id"  :4,
                                    "text":"FM-4200"
                                }
                            ]
                        },
                        {
                            "id"   :5,
                            "text" :"Bikes",
                            "items":[
                                {
                                    "id"  :6,
                                    "text":"FM-3100"
                                }
                            ]
                        }
                    ]
                },
                {
                    "id"   :7,
                    "text" :"Personnel",
                    "items":[
                        {
                            "id"   :8,
                            "text" :"Personnel",
                            "items":[
                                {
                                    "id"   :9,
                                    "text" :"Clients",
                                    "items":[
                                        {
                                            "id"  :10,
                                            "text":"GH-3000"
                                        }
                                    ]
                                },
                                {
                                    "id"   :11,
                                    "text" :"VIPs",
                                    "items":[
                                        {
                                            "id"  :12,
                                            "text":"GH-3100"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
    

    Where each element has an id a text that is what will show up in the tree and an array items containing each subelement of the tree.

    If so, your code should be:

    $.getJSON("/testTree.json", function (data) {
        $("#treeview").kendoTreeView({
            dataSource: data
        });
    })
    

    Where /testTree.json is the URL of your JSON file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a file tree similarly to java2s.com 'Create a lazy file
i want create a custom json data from the mssql 2008 results so that
I want to create binary search tree data structure in C/C++ where each node
I want to create tree structure using web service. I have used bottom up
I want to create a tree panel in sencha touch, but I am unable
I want to create a classification tree in Matlab using classregtree. However, a lot
I am trying to implement a B+ tree myself, but I want to create
I'm using jstree to create a multi-level tree, and I want to be able
I want to create my own expandable/collapsable tree-like UserControl, which nodes are the Border
I want to be able to create a tree view that can get its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.