jQuery UI Widgets Forums Navigation Tree Hierarchical Tree

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 9 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Hierarchical Tree #80107

    pratibhapandey
    Participant

    Hello Team,

    I have a JSON in below format:
    var projectResources = [
    {
    “projectId”: 2, “projectName”: “Project1”,
    resources: [
    { “resourceId”: 8, “Name”: “Pratibha Pandey”, “Designation”: “ATL” },
    { “resourceId”: 9, “Name”: “Pratibha Pandey”, “Designation”: “ATL” },
    { “resourceId”: 10, “Name”: “Pratibha Pandey”, “Designation”: “ATL” },
    { “resourceId”: 11, “Name”: “Pratibha Pandey”, “Designation”: “ATL” }

    ]
    },
    {
    “projectId”: 2, “projectName”: “Project2”,
    resources: [
    { “resourceId”: 12, “Name”: “Pratibha Pandey1”, “Designation”: “ATL” },
    { “resourceId”: 13, “Name”: “Pratibha Pandey1”, “Designation”: “ATL” },
    { “resourceId”: 14, “Name”: “Pratibha Pandey1”, “Designation”: “ATL” },
    { “resourceId”: 15, “Name”: “Pratibha Pandey1”, “Designation”: “ATL” }
    ]
    }
    ];

    I need to create a jqxTree out of this hierarchy.

    Can you please help me up with creating the source, dataAdapter, and recordsHierarchy for this JSON. As I can not change the format of JSON.

    Thanks,
    Pratibha

    Hierarchical Tree #80258

    Hristo
    Participant

    Hello Pratibha,

    The data from JSON is not very consistent.
    Please take a look this example: http://jsfiddle.net/txhi/y3zgr3aw/
    In case if you use the example above there is not need to use dataAdapter.
    If you would like to read more about dataAdapter please take a look this article:
    https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm?search=
    Below is one demo with hierarchical structure:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/events.htm?arctic

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.