Kendo UI Grid一列不显示数据

时间:2015-05-12 16:57:51

标签: javascript jquery kendo-ui kendo-grid

我有一个Kendo UI grid,在开发方面效果很好。当我将其部署到生产环境时,只显示其中一列(Salesperson)中的数据。我一点也没有错。当我查看源代码时,td只是空的。我多年来一直使用Stackoverflow,之前从未问过问题。任何帮助将不胜感激。

<script>
    $("#gridDirectSOsWithoutPOs").kendoGrid({
        dataSource: {
            transport: {
                read: function(options) {
                    $.ajax({
                        type: "POST",
                        url: "salesorder_home.aspx/GetDirectSOsWithoutPOs",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function(data) {
                            options.success(data);
                            $("tr", "#gridDirectSOsWithoutPOs").each(function(idx, elem) {
                                var valCell2 = $(":nth-child(2)", elem).html();
                                if (valCell2 < 90) {
                                    $(":nth-child(2)", elem).addClass('redCell');
                                }
                            });
                        },
                        error: function(xhr, textStatus, errorThrown) {
                            alert(xhr.responseText);
                        }
                    });
                }
            },
            schema: {
                data: "d",
                model: {
                    fields: {
                        PromiseDate: {
                            type: "date"
                        },
                        DaysLeft: {
                            type: "number"
                        },
                        SODate: {
                            type: "date"
                        },
                        Salesperson: {
                            type: "string"
                        },
                        OrderNumber: {
                            type: "number"
                        },
                        OrderAmount: {
                            type: "number"
                        }
                    }
                }
            }
        },
        filterable: false,
        sortable: true,
        columns: [{
            field: "PromiseDate",
            title: "Promise Date",
            template: "#= kendo.toString(kendo.parseDate(PromiseDate, 'yyyy-MM-dd'), 'M/d/yyyy') #",
            width: 80,
            attributes: {
                style: "text-align: center;"
            }
        }, {
            field: "DaysLeft",
            title: "Days Left",
            width: 45,
            attributes: {
                style: "text-align: center;"
            }
        }, {
            field: "SODate",
            title: "SO Date",
            template: "#= kendo.toString(kendo.parseDate(SODate, 'yyyy-MM-dd'), 'M/d/yyyy') #",
            width: 80,
            attributes: {
                style: "text-align: center;"
            }
        }, {
            field: "Customer",
            title: "Customer",
            template: '<a href="javascript:window.location(\'../customer/customer.aspx?number=#=Number#\')" style="text-decoration: none;">#=Customer#</a>',
            width: 150
        }, {
            field: "VendorCountry",
            title: "Vendor Country",
            width: 55,
            attributes: {
                style: "text-align: center;"
            }
        }, {
            field: "Salesperson",
            title: "Salesperson",
            width: 120
                //attributes: {
                //    style: "text-align: center;"
                //}
        }, {
            field: "OrderNumber",
            title: "Order Number",
            template: '<a href="javascript:window.location(\'../salesorder/salesorder.aspx?ordnum=#=OrderNumber#\')" style="text-decoration: none;">#=OrderNumber#</a>',
            width: 60,
            attributes: {
                style: "text-align: center;"
            }
        }, {
            field: "OrderAmount",
            title: "Order Amount",
            format: "{0:n0}",
            width: 70,
            attributes: {
                style: "text-align: right;"
            }
        }]
    });
</script>

<div id="gridDirectSOsWithoutPOs" class="k-grid"></div>

1 个答案:

答案 0 :(得分:0)

谢谢大家,问题似乎已经解决了。上周我们确实遇到了一些严重的网络问题,许多服务器之间的信任关系被打破了。认为他们都是固定的,但我现在正在将其归结为“挥之不去的问题”。我要仔细检查我今天早上是否正确处理了所有可能的空值并继续前进。 @Icepickle:小提琴手!它就在我的任务栏上。我用它所以很少忘记它就在那里。再次感谢!