Kendo UI网格一栏不显示数据
Kendo UI Grid one column does not display data
我有一个 Kendo UI grid
在开发中效果很好。当我将它部署到生产环境时,只有一列(销售人员)中的数据没有出现。我完全没有错误。当我查看源代码时,td 是空的。我使用 Whosebug 多年,以前从未问过问题。任何帮助将不胜感激。
<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>
谢谢大家,问题似乎已自行解决。上周我们确实遇到了一些严重的网络问题,许多服务器之间的信任关系被破坏了。以为它们都已修复,但我暂时将其归结为 "lingering issues"。今天早上我要仔细检查我是否正确处理了所有可能的空值,然后继续。 @Icepickle:小提琴手!它就在我的任务栏上。我很少使用它,以至于我忘记了它的存在。再次感谢!
我有一个 Kendo UI grid
在开发中效果很好。当我将它部署到生产环境时,只有一列(销售人员)中的数据没有出现。我完全没有错误。当我查看源代码时,td 是空的。我使用 Whosebug 多年,以前从未问过问题。任何帮助将不胜感激。
<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>
谢谢大家,问题似乎已自行解决。上周我们确实遇到了一些严重的网络问题,许多服务器之间的信任关系被破坏了。以为它们都已修复,但我暂时将其归结为 "lingering issues"。今天早上我要仔细检查我是否正确处理了所有可能的空值,然后继续。 @Icepickle:小提琴手!它就在我的任务栏上。我很少使用它,以至于我忘记了它的存在。再次感谢!