jQWidgets Forums

jQuery UI Widgets Forums General Discussions Change data format

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Change data format #64514

    ajayetw1987
    Participant

    Hi Sir,

    There is any method for create this type of that
    var data = [
    {
    “id”: “1”, “name”: “Corporate Headquarters”, “budget”: “1230000”, “location”: “Las Vegas”,
    “children”:
    [
    {
    “id”: “2”, “name”: “Finance Division”, “budget”: “423000”, “location”: “San Antonio”,
    “children”:
    [
    { “id”: “3”, “name”: “Accounting Department”, “budget”: “113000”, “location”: “San Antonio” },
    {
    “id”: “4”, “name”: “Investment Department”, “budget”: “310000”, “location”: “San Antonio”,
    children:
    [
    { “id”: “5”, “name”: “Banking Office”, “budget”: “240000”, “location”: “San Antonio” },
    { “id”: “6”, “name”: “Bonds Office”, “budget”: “70000”, “location”: “San Antonio” },
    ]
    }
    ]
    },
    {
    “id”: “7”, “name”: “Operations Division”, “budget”: “600000”, “location”: “Miami”,
    “children”:
    [
    { “id”: “8”, “name”: “Manufacturing Department”, “budget”: “300000”, “location”: “Miami” },
    { “id”: “9”, “name”: “Public Relations Department”, “budget”: “200000”, “location”: “Miami” },
    { “id”: “10”, “name”: “Sales Department”, “budget”: “100000”, “location”: “Miami” }
    ]
    },
    { “id”: “11”, “name”: “Research Division”, “budget”: “200000”, “location”: “Boston” }
    ]
    }
    ];

    from array like Array[23]
    0: Object
    1: Object
    2: Object
    3: Object
    4: Object
    5: Object
    6: Object
    7: Object

    Exp:

    Input array: array like

    Array[23]
    0: Object
    1: Object
    2: Object
    3: Object
    4: Object
    5: Object
    6: Object
    7: Object

    OutPut:

    var data = [
    {
    “id”: “1”, “name”: “Corporate Headquarters”, “budget”: “1230000”, “location”: “Las Vegas”,
    “children”:
    [
    {
    “id”: “2”, “name”: “Finance Division”, “budget”: “423000”, “location”: “San Antonio”,
    “children”:
    [
    { “id”: “3”, “name”: “Accounting Department”, “budget”: “113000”, “location”: “San Antonio” },
    {
    “id”: “4”, “name”: “Investment Department”, “budget”: “310000”, “location”: “San Antonio”,
    children:
    [
    { “id”: “5”, “name”: “Banking Office”, “budget”: “240000”, “location”: “San Antonio” },
    { “id”: “6”, “name”: “Bonds Office”, “budget”: “70000”, “location”: “San Antonio” },
    ]
    }
    ]
    },
    {
    “id”: “7”, “name”: “Operations Division”, “budget”: “600000”, “location”: “Miami”,
    “children”:
    [
    { “id”: “8”, “name”: “Manufacturing Department”, “budget”: “300000”, “location”: “Miami” },
    { “id”: “9”, “name”: “Public Relations Department”, “budget”: “200000”, “location”: “Miami” },
    { “id”: “10”, “name”: “Sales Department”, “budget”: “100000”, “location”: “Miami” }
    ]
    },
    { “id”: “11”, “name”: “Research Division”, “budget”: “200000”, “location”: “Boston” }
    ]
    }
    ];
    Thanks with Regards,
    Rinku

    Change data format #64518

    Peter Stoev
    Keymaster

    Hi Rinku,

    We do not have functions for auto-generating data inside our widgets.

    Best Regards,
    Peter Stoev

    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.