0

使用 jqgrid 我发现它生成了 2 个单独的表。一个表只是生成标题行,我可以从中对列进行排序。第二列是实际数据。我想为标题和内容生成一个表,因为 2 个表导致对齐问题。

这是我的代码

$("#myGridView").jqGrid({
    url: 'urlto/records',
    datatype: 'json',
    mtype: 'GET',
    height: 300,
    width : 960,
    colNames : [ 'ID', 'Date', 'Name', 'Email Address'],
    colModel : [ 
             { name : 'id', index : 'id', align : "center", sortable : true, classes: 'viewLidsGrid_id'}, 
             { name : 'dateReceived', index : 'dateReceived', align : "center", sorttype : "date", sortable: true},
             { name : 'name', index : 'name', align : "center", sortable:true}, 
             { name : 'email', index : 'email',  align : "center", sortable : true}, 
        ],
    postData: {},
    serializeGridData: function(postData) {
            var newPostData = $.extend(postData, {
                uuid: $("#requestUUID").val()
            });
            return $.param(newPostData);
    },
    rowNum:config.getJQGridRowCount(),
    rowList:config.getJQGridRows(),
    pager: '#pager',
    sortname: 'id',
    viewrecords: true,
    toppager: true,
    sortorder: "asc",
    caption:"Records",
    emptyrecords: "Empty records",
    loadonce: false,
    jsonReader : {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems: false,
        cell: "cell",
        id: "id"
    }
    }).jqGrid('navGrid','#pager',{cloneToTop:true, edit:false,add:false,del:false, search:false});
4

0 回答 0