Jqgrid继续加载

Jqgrid继续加载,jqgrid,Jqgrid,我的jqGrid显示出来了,但是它没有显示我在json源代码中检查过的数据,而且还可以 $(document).ready(function () { $("#grid").jqGrid( { url: 'GetDepartment', datatype: 'json', mtype: 'GET', colNames: ['Department ID', 'Department Name'], co

我的
jqGrid
显示出来了,但是它没有显示我在json源代码中检查过的数据,而且还可以

 $(document).ready(function () {
    $("#grid").jqGrid(
    {
        url: 'GetDepartment',
        datatype: 'json',
        mtype: 'GET',
        colNames: ['Department ID', 'Department Name'],
        colModel: [
            { name: 'DepartmentID', index: 'DepartmentID' },
            { name: 'DepartmentName', index: 'DepartmentName'}
        ],
        pager: $("#GridPager"),
        rowNum: 2,
        rowList: [5, 10, 15, 20],
        width: 'auto',
        sortname: 'DepartmentID',
        sortorder: "ASC"
    })
    $("#grid").jqGrid('navGrid', '#GridPager', { add: false, edit: false, del: false, search: false})
})

我认为您缺少jsonReader,请将以下代码添加到网格中

            jsonReader: {
            repeatitems: false
            id: "DepartmentID"

        },
查看wiki,了解预期的json格式

因此,在您的情况下,json响应应该是

{  "rows":[{"DepartmentID":2,"DepartmentName":"Asset Mgmt Group "},{"DepartmentID":16,"DepartmentName":"Business Solutions Group"},{"DepartmentID":8,"DepartmentName":"CBMG"}] } 

您是如何检查Json是否正常的?如果您转到
GetDepartment
url,您将返回正确格式的Json数据?我使用Fiddler检查它并返回正确的Json数据格式