0

jqgrid には、レコード数が正しく表示されているにもかかわらず、黒いテーブルが表示されています。JSON 文字列を返す Web サービスを使用しています。ajax 呼び出しから返されたデータを見ることができますが、テーブルには表示されません。 Webサービスから取得したjsonデータは次のとおりです。

Json:
 [{"profile_id":"413a75c9-03b4-4660-841b-2d213a2e2b95", "id":"313","first_name":"abc", "email":"abc@gmail.com"} , {"profile_id":"498fa726-0a34-4bbd-baab-6b4f2eb13bcf" , "id":"308" , "first_name":"xyz" , "email":"xyz@gmail.com"}]

    $.ajax({
            url:'rest/WebService/Getdata',
            dataType:'json', 
            success: function (data_response) {
                jqgrid(JSON.stringify(data_response));
            },
            error: function (error) {
                alert("error");
                alert(JSON.stringify(error));
            }
            });

    function jqgrid(jsondata){
        $("#list3").jqGrid({
        datatype:"jsonstring",
        datastr:jsondata,
        colNames:['Profile_id','id', 'Name', 'Email'],
        colModel:[
            {name:'Profile_id',index:'profile_id', width:500},
            {name:'id',index:'id', width:250},
            {name:'Name',index:'first_name', width:300},
            {name:'Email',index:'email', width:240} 
        ],
        jsonReader: {
            id: "1",
            cell: "",
            root: "root",
            page: "page",
            total: "total",
            records: "records",
            repeatitems: false
        },      
        emptyrecords: "Nothing to display",
        rowNum:10,
        rowList:[10,20,30],
        pager: $('#pager3'),
        viewrecords: true,
        sortorder: "desc",
        caption: "Data table"
    });
    }
4

1 に答える 1