jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • rmichel
    Participant

    Thanks, I couldn’t find the documentation for dataAdapter, but with your answer I was able to find it and this code works:

    var source =
    {
        datatype: "json",
        datafields: [
            {name: 'id_incoterm'},
            {name: 'code'},
            {name: 'name'},
            {name: 'designation_en'}
        ],
        id: 'id',
        url: site_url + '/Services/ReferenceFiles/Incoterms/GetData',
        root: 'response'
    };
    var dataAdapter = new $.jqx.dataAdapter(source, {
        beforeLoadComplete: function(records, data){
            return data.response.result.incoterms;
        }
    });
    $("#incoterms-grid").jqxGrid({
        width: '100%',
        source: dataAdapter,
        columnsresize: true,
        columns: [
          {text: 'ID', dataField: 'id_incoterm'},
          {text: 'Code', dataField: 'code'},
          {text: 'Designation FR', dataField: 'name'},
          {text: 'Designation EN', dataField: 'designation_en'},
          {text: 'Action', width: 90}
        ]
    });
Viewing 1 post (of 1 total)