jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • larsm
    Member

    Of course – thanks for clarifying.

    I did get it to work across domain using JSONP and a local Array (see code below), but it didn’t strike me that the built in method was having this issue.

    Looking forward to the new JSONP support…

    /LM

    $(document).ready(function ()
    {
    var url = ‘http://my-service/jsontest/service1?callback=?’;
    $.getJSON(url, null, function (jsondata)
    {
    var data = new Array();
    for (var i = 0; i < jsondata.length – 1; i++)
    {
    var row = {};
    row["Id"] = jsondata[i].Id;
    row["StringValue"] = jsondata[i].StringValue;
    data[i] = row;
    }

    var source =
    {
    data: data,
    datatype: "array"
    };

    $("#jqxgrid").jqxGrid(
    {
    source: source,
    sortable: true,
    columns:
    [
    { text: 'Key', datafield: 'Id', width: 50 },
    { text: 'Value', datafield: 'StringValue', width: 250 }
    ]
    });
    });
    });

Viewing 1 post (of 1 total)