jQuery UI Widgets Forums Plugins Data Adapter Load object array data in json

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Load object array data in json #96687

    EricK
    Participant

    How do I load this data using datatype json adapter?
    Using your sample datatable example
    https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdatatable/index.htm#demos/jqxdatatable/javascript-datatable-rows-rendering.htm

    [
    {
    laptops:
    [
    { img: ‘../../images/l-13.jpg’, ram: ‘8GB DD3’, cpu: ‘Intel Core i7-3720QM’, price: 2999, display: 15.4, hdd: ‘512GB SSD’, model: ‘Apple MacBook Pro’ },
    { img: ‘../../images/l-14.jpg’, ram: ‘8GB DD3’, cpu: ‘Intel Core i7-3667U’, price: 1299, display: 13.3, hdd: ‘256GB SSD’, model: ‘Apple MacBook Air’ },
    { img: ‘../../images/l-15.jpg’, ram: ‘8GB DD3’, cpu: ‘Intel Core i7-3632QM’, price: 2199, display: 15.4, hdd: ‘256GB SSD’, model: ‘Asus ZenBook UX51VZ’ }
    ]
    }
    ]

    var ptsource = {
    dataType: “json”,
    dataFields: [
    {name: ‘laptops’, type: ‘string’}, ???????
    {name: ‘img’, type: ‘string’},
    {name: ‘ram’, type: ‘string’},
    {name: ‘cpu’, type: ‘string’},
    {name: ‘price’, type: ‘number’},
    {name: ‘display’, type: ‘string’},
    {name: ‘hdd’, type: ‘string’},
    {name: ‘model’, type: ‘string’}
    ],

    data: {qtable: ‘productxx’},
    url: ‘typexxx.php’

    };
    var ptdataAdapter = new $.jqx.dataAdapter(ptsource);

    Any assistance will be greatly appreciated.

    Load object array data in json #96723

    Stanislav
    Participant

    Hello EricK,

    Take a look at our JSON Data, its an example of how to set-up and use JSON data.
    The other thing I can suggest is to take a look at our jqxDataAdapter API.
    If you have any more questions, ask please ask them!

    Best Regards,
    Stanislav

    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.