0

我有一个以 XML 格式返回数据的表单。我使用 jqxGrid。在“批准日期”列中,我可以返回 Empty,但 jqxgrid 返回 01/01/1900。如果为空,我如何使该列返回空或隐藏列的函数?

$(document).ready(function () {
        source =
        {
            datatype: "xml",
            datafields: [
                { name: 'User', type: 'string' },
                { name: 'ApprovalDate', type: 'date' },
                { name: 'UserRequestor', type: 'string' }
            ],
            async: false,
            record: 'Table',
            url: 'Tickets.aspx/GetTickets',
        };

        var dataAdapter = new $.jqx.dataAdapter(source, {
        contentType: 'application/json; charset=utf-8'}
        );
        $("#jqxgrid").jqxGrid(
        {
            width: '100%',
            source: dataAdapter,
            theme: 'classic',
            columns: [
              { text: 'User', datafield: 'User', align: 'center', width: 200 },
              { text: 'Approval Date', datafield: 'ApprovalDate', align: 'center', cellsformat: 'dd/MM/yyyy', width: 120  },
              { text: 'User Requestor', datafield: 'UserRequestor', align: 'center', width: 200 },

            ]
        });
    });
4

0 回答 0