gpt4 book ai didi

javascript jsGrid 未加载

转载 作者:行者123 更新时间:2023-12-03 01:49:05 25 4
gpt4 key购买 nike

我从网上这个简单的示例中获取了源代码:http://js-grid.com/demos/basic.html .

我通过添加 jsGrid 的完整 CDN 路径来对其进行调整。为了简洁起见,我删除了除两列之外的所有网格列...从 springboot 应用程序启动页面...表头显示但不显示示例 json 数据。

这就是我最终得到的结果,但不起作用..

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Basic Scenario - jsGrid Demo</title>

<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/css/demos.css" />
<link rel="stylesheet" type="text/css" href="/css/jsgrid.min.css" />
<link rel="stylesheet" type="text/css" href="/css/jsgrid-theme.min.css" />

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>

<script>window.jQuery || document.write('<script src="/js/jquery-1.8.3.js"><\/script>')</script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.2/jsgrid.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.2/jsgrid.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.2/jsgrid.min.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.2/jsgrid.min.js"></script>
</head>
<body>
<h1>Basic Scenario</h1>

<div id="jsGrid"></div>

<script>


$("#jsGrid").jsGrid({
height: "90%",
width: "100%",

filtering: true,
editing: true,
sorting: true,
paging: true,
autoload: true,

pageSize: 15,
pageButtonCount: 5,

deleteConfirm: "Do you really want to delete the client?",

controller: {
loadData: function(filter) {
return {
data: [{"Name":"Edmund","Age": "25"},
{"Name":"Edmund","Age": "25"}
],
itemsCount: 2
};
}
},

fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "text", width: 50 }
]
});


</script>

</body>
</html>

有什么想法吗?

最佳答案

如果 pageLoading 设置为 true,那么您在 controller.loadData 中返回的数据结构似乎是有效的。否则你可以简单地使用:

controller: {
loadData: function(filter) {
return [
{ Name: 'Edmund', Age: '25' },
{ Name: 'Edmund', Age: '25' },
];
},
},

来源:http://js-grid.com/docs/#controller

关于javascript jsGrid 未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50497035/

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