jQWidgets Forums

jQuery UI Widgets Forums Vue json – array in grid

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • json – array in grid #113795

    gy.lee
    Participant
    
    var data = [{ "empName": "test", "age": "67", 
                  "department": { "id": "1234", "name": "Sales", 
                                  "id": "2345", "name": "hello"
                                }, 
                  "author": "ravi"}];
    // prepare the data
    
    var source =
    {
        datatype: "json",
        datafields: [
            { name: 'empName' },
            { name: 'age' },
            { name: 'id', map: 'department>id' },//show nothing, department>0>id -> return 1234
            { name: 'name', map: 'department>name' },
            { name: 'author' }
        ],
        localdata: data
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    

    how can i access every id in department?

    json – array in grid #113808

    Hristo
    Participant

    Hello gy.lee,

    The data that you provide in the department is one object with the same-named fields.
    I would like to suggest to you an example of a possible solution.
    Please, take a look at this example:
    http://jsfiddle.net/sba940tq/
    Also, the naming of the inner items is so specific (for this reason I rename them a little).

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.