Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
json webservice datasource
posted

I am trying to populate a grid with data from a web servive method call. I'm getting the data returned in the correct format and the grid loads with no data displayed. I can see that I am getting 190 records returned from the call. Can you see anything wrong below?

 

 

       $.ig.loader({

            scriptPath: "../../js/", 

cssPath: "../../css/",

resources: "igGrid.Paging,igGrid.Sorting,igGrid.Filtering"

        });

 

var CabinetList;

        $(document).ready(

function () {

            GetCabinets();

        });

 

       

var url = "../../../../Inventory.asmx/getCabinets3";

var dataParams = '';

 

function GetCabinets() {

            $.ajax({

                type: "POST",

                url: url,

                async: false,

                data: '{' + dataParams + '}',

                contentType: "application/json; charset=utf-8",

                dataType: "json",

                success: function (data) {

                    CabinetList = { "Records": [data.d] };

                   //alert([data.d]);

                   //document.write(data.d);

                },

                error: function (xhr, ajaxOptions, thrownError) {

                    alert(xhr.responseText);

                    alert(thrownError);

                }

            });

        }

 

$.ig.loader( function () {

 

        $(function () {

            $("#grid1").igGrid({

                columns: [{

                    headerText: "Cabinet ID",

                    key: "cabinetid",

                    dataType: "string"

                },

                            {

                                headerText: "Title",

                                key: title",

                                dataType: "string"

                            }],

              features: [

                     {

                         name: 'Paging',

                         pageSize: 20

                     },

                     {

                         name: 'Sorting'

                     },

                     {

                         name: 'Filtering',

                         filterDropDownItemIcons: false,

                         filterDropDownWidth: 200

                     }

                 ],

                

                autoGenerateColumns: false,

                dataSource: CabinetList.Records,

                dataType: "json",

                height: 300

            });

        });

 

    });