javascript jsGrid 未加载

javascript jsGrid not loading

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

我通过为 jsGrid 添加完整的 cdn 路径对其进行了修改。为了简洁起见,我删除了除两个网格列之外的所有列...从 springboot 应用程序启动页面... Table headers 显示但不显示样本 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