jQWidgets Forums

jQuery UI Widgets Forums Getting Started dataAdapter data undefined

This topic contains 1 reply, has 1 voice, and was last updated by  atomic 11 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • dataAdapter data undefined #31258

    atomic
    Participant

    Hi,

    i am trying to fill jqxInput and jqxCheckbox data from json when I load page. But when I try to acces data I get undefiened values.

    var source =
    {
    url: ‘cases/EditCase_data.php’,
    root: ‘data’,
    datatype: ‘json’,
    cache: false,
    datafields: [
    { name: ‘name’, type: ‘string’ },
    { name: ‘description’, type: ‘string’ }]
    };
    var dataAdapter = new $.jqx.dataAdapter(source,
    {
    loadComplete: function(){
    var records = dataAdapter.records;
    var lenght =dataAdapter.records.lenght;
    $(“#casename”).jqxInput(‘val’, records.name);
    $(“#description1”).jqxInput(‘val’, records.description)
    }
    }
    );

    $(“#casename”).jqxInput({ placeHolder: “Case name”, height: 25, width: 200, minLength: 1, });
    $(“#description1”).jqxInput({ placeHolder: “Case description”, height: 100, width: 200, minLength: 1, });

    Any help would be appreciated.
    Best regards

    dataAdapter data undefined #31262

    atomic
    Participant

    Hej,
    json data get returned in array,so I was missing this

    $(“#casename”).jqxInput(‘val’, records[0].name);

    Sorry for disturbing you, but I lost couple of hours with this one.

    Thanks anyway!!!

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

You must be logged in to reply to this topic.