jqGrid添加'数据验证'行

时间:2017-11-17 16:55:37

标签: jquery jqgrid

我有一个jqGrid,我正在填充存储过程中的数据。我从proc中返回了所需的结果,但它正在添加一个“数据验证”'在前端排。我无法弄清楚它是从哪里得到的。它还添加了行(参见ID)3次,并以某种方式拉出不同的位置。

奇怪的是,它似乎只发生在Delivered By列中Dev Tx专家的记录中。This is the jqGrid

Stored Procedure results

我在应用程序中以相同的方式设置了其他网格,并且它们正常工作。有没有人见过这个?

function GetGridData() {
jQuery("#grid").jqGrid({
    url: 'ServiceDelivery.aspx/GetIFSPDetails',
    mtype: 'POST',
    datatype: 'json',
    colNames: ['ID', 'Service', 'Location', 'Delivered By', 'Frequency', 'Per', 'Hrs', 'Start', 'End', 'Initials'],
    colModel: [
               { name: 'IFSPDetailId', index: 'IFSPDetailID', key: true, search: false, hidden: false, width: 50, align: "left", editable: false, editrules: { required: true } },
               { name: 'Service', index: 'Service', key: true, search: false, hidden: false, width: 90, align: "left", editable: false, editrules: { required: true } },
               { name: 'ServiceLocation', index: 'ServiceLocation', key: true, search: false, hidden: false, width: 60, align: "left", editable: false, editrules: { required: true } },
               { name: 'DeliveredBy', index: 'DeliveredBy', key: true, search: false, hidden: false, width: 150, align: "left", editable: false, editrules: { required: true } },
               { name: 'Frequency', index: 'Frequency', key: true, search: false, hidden: false, width: 70, align: "left", editable: false, editrules: { required: true } },
               { name: 'Per', index: 'Per', key: true, search: false, hidden: false, width: 40, align: "left", editable: false, editrules: { required: true } },
               { name: 'Duration', index: 'Duration', key: true, search: false, hidden: false, width: 50, align: "left", editable: false, editrules: { required: true } },
               { name: 'StartDate', index: 'StartDate', key: true, search: false, hidden: false, width: 70, align: "left", editable: false, editrules: { required: true }, formatter: 'date', formatoptions: { newformat: 'n/j/Y' } },
               { name: 'EndDate', index: 'EndDate', key: true, search: false, hidden: false, width: 70, align: "left", editable: false, editrules: { required: true }, formatter: 'date', formatoptions: { newformat: 'n/j/Y' } },
               { name: 'Initials', index: 'Initials', key: true, search: false, hidden: false, width: 50, align: "left", editable: false, editrules: { required: true } },

    ],
    ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
    serializeGridData: function (postData) {

        if (_typeChanged) {
            postData.page = 1;
            _typeChanged = false;
        }


        if (postData.searchField == null) {
            postData.searchField = "";
            postData._search = false;
            postData.searchOper = "";
            postData.searchString = "";
            postData.serviceDate = $$('txtServiceDate').val();
            postData.caseId = vm.caseId();
        }

        return JSON.stringify(postData);

    },
    jsonReader: {
        id: "IFSPDetailId",

        root: function (obj) {
            if (obj.d != "") {
                var x = $.parseJSON(obj.d);
                return x.rows;
            }
        },
        page: function (obj) {
            if (obj.d != "") {
                var x = $.parseJSON(obj.d);
                return x.page;
            }
        }, total: function (obj) {
            if (obj.d != "") {
                var x = $.parseJSON(obj.d);
                return x.total;
            }
        }, records: function (obj) {
            if (obj.d != "") {
                var x = $.parseJSON(obj.d);
                return x.rows.length;
            }
        }, repeatitems: false

    },
    loadBeforeSend: function (xhr) {

    },
    loadComplete: function (data) {

    },
    loadError: function (xhr, st, err) {
        alert("Type: " + st + "; Response: " + xhr.status + " " + xhr.statusText);
    },
    pager: jQuery('#pager'),
    rowNum: 50,
    rowList: [50, 100, 150, 200],
    sortname: '',
    sortorder: "",
    modal: true,
    viewrecords: false,
    shrinkToFit: false,
    caption: '',
    loadonce: true,
    width: 770,
    height: 300,
    editurl: '',
    grouping: false,
    footerrow: false,
    hoverrows: false,
    grouping: false,
    footerrow: false,
    userDataOnFooter: true,
    onSelectRow: function () {
        $('#divIFSPDetailModal').dialog("close");
        getSelectedRowData('ifsp');
    }
}).navGrid("#pager", { edit: false, add: false, del: false, search: false, refresh: false, view: false })}

0 个答案:

没有答案