kendo网格选择不起作用

时间:2014-01-24 09:22:58

标签: javascript jquery kendo-ui kendo-grid

这是我的示例页面,其中包含一个简单的kendo网格:

<html>
<head>
<meta charset="utf-8">
<title>New</title>
<link href="../styles/kendo.common.min.css" rel="stylesheet" />
<link href="../styles/kendo.default.min.css" rel="stylesheet" />
<script src="../jQuery/jquery-2.0.0.min.js"></script>
<script src="../js/kendo.all.min.js"></script>
</head>
<body>

<div id="grid"></div>
<script>
    $("#grid").kendoGrid({
        columns: [
          { field: "name" },
          { field: "age" }
        ],
        dataSource: [
          { name: "Jane Doe", age: 30 },
          { name: "John Doe", age: 33 }
        ],
        selectable: true
    });
</script>
</body>
</html>

使用firefox和explorer,行选择不起作用.... 提前谢谢!

1 个答案:

答案 0 :(得分:2)

尝试将代码包装在DOM中:

$(function() {
    $("#grid").kendoGrid({
        columns: [
          { field: "name" },
          { field: "age" }
        ],
        dataSource: [
          { name: "Jane Doe", age: 30 },
          { name: "John Doe", age: 33 }
        ],
        selectable: true
    });
});

确保在准备好使用页面的所有DOM元素后调用函数。