gpt4 book ai didi

javascript - 为什么数据不显示在 kendo ui 网格上

转载 作者:行者123 更新时间:2023-11-28 04:10:26 26 4
gpt4 key购买 nike

我的鳕鱼如下

var loadGridEmployee = function(listEmployee) {
var grid = $("#grdemployees").data("kendoGrid");
if (!grid) {
grid = $("#grdemployees").kendoGrid({
height: 600,
columns: [
{ field: "ID", title:"ID", width: "100px" },
{ field: "Name", title:"Name", width: "150px"},
{ field: "Phone", title: "Phone", width: "150px"}
],
sortable: true,
resizable: true,
selectable: true,

pageable: {
pageSize: 20,
messages: {
display: "{0}-{1} \/ {2}"
}
},
noRecords: {
template:"xx" + ": List is empty"
}
}).data("kendoGrid");
}
grid.dataSource.data(listEmployee);

return grid;

}
$(document).ready(function () {

var grid = loadGridEmployee(listEmployee);

})
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
<script type="text/javascript">
var listEmployee = = [{"id":1,"name":"Dang Quang Hai","phone":"34563653434"}, {"id":2,"name":"Dang Gia Huy","phone":"78568534r234"}, {"id":3,"name":"Dang Hoang Linh Chi","phone":"56745745"}, {"id":4,"name":"tran binh trong","phone":"23234234r"}, {"id":5,"name":"Quang Tèo","phone":"123"}, {"id":6,"name":"hihihihih","phone":"31241"}];

</script>
<title>Insert title here</title>
</head>
<body>
<div id="grdemployees"></div>
<h1>Test list</h1>
</body>
</html>

不知道为什么数据没有出现在网格上。结果我只收到了网格的一些列标题,如下图所示。 奥 git _a请帮我我添加了我需要的全部内容,为什么 STACKOVER 不同意发布这个问题?

最佳答案

对不起,

我发现了我的错误。字段名称必须是这样的ID->id,姓名->姓名,电话->电话。因为我的表在数据库中。

关于javascript - 为什么数据不显示在 kendo ui 网格上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46334739/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com