【问题标题】:JQuery JSGrid: Not workingJQuery JSGrid:不工作
【发布时间】:2017-05-16 20:39:54
【问题描述】:

有人可以帮我看看为什么这个 Fiddle 不起作用。这是我第一次玩 JQuery 之类的东西。

<#include>
https://jsfiddle.net/rohit12sh/wk7exxhj/2/

这是我的 index.html 文件。不知道为什么它不工作。 我也没有在开发者工具中看到任何控制台错误

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="UTF-8" />
    <title>To-do List</title>

    <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid.min.js" />

    <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid.min.css" />
    <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid-theme.min.css" />



    <script>
        var clients = [
            { "Name": "Otto Clay", "Age": 25, "Country": 1, "Address": "Ap #897-1459 Quam Avenue", "Married": false },
            { "Name": "Connor Johnston", "Age": 45, "Country": 2, "Address": "Ap #370-4647 Dis Av.", "Married": true },
            { "Name": "Lacey Hess", "Age": 29, "Country": 3, "Address": "Ap #365-8835 Integer St.", "Married": false },
            { "Name": "Timothy Henson", "Age": 56, "Country": 1, "Address": "911-5143 Luctus Ave", "Married": true },
            { "Name": "Ramona Benton", "Age": 32, "Country": 3, "Address": "Ap #614-689 Vehicula Street", "Married": false }
        ];

        var countries = [
            { Name: "", Id: 0 },
            { Name: "United States", Id: 1 },
            { Name: "Canada", Id: 2 },
            { Name: "United Kingdom", Id: 3 }
        ];

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

            inserting: true,
            editing: true,
            sorting: true,
            paging: true,

            data: clients,

            fields: [
                { name: "Name", type: "text", width: 150, validate: "required" },
                { name: "Age", type: "number", width: 50 },
                { name: "Address", type: "text", width: 200 },
                { name: "Country", type: "select", items: countries, valueField: "Id", textField: "Name" },
                { name: "Married", type: "checkbox", title: "Is Married", sorting: false },
                { type: "control" }
            ]
        });
    </script>

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

</body>
</html>

感谢您的帮助。

【问题讨论】:

    标签: jquery jquery-ui jsgrid


    【解决方案1】:

    请在更新后的链接中找到答案。 Updated Link

    <table id="jsGrid"></table>
    

    【讨论】:

    • 这个小提琴确实有效,但是当我在 HTML 中移动代码时,它不起作用。
    【解决方案2】:

    jsgrid 将不支持&lt;!DOCTYPE html&gt;。如果我们删除&lt;!DOCTYPE html&gt;,那么 jsgrid 就可以工作了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-31
      • 1970-01-01
      • 1970-01-01
      • 2013-04-17
      • 2012-08-22
      • 2017-06-19
      相关资源
      最近更新 更多