pasluc74669
pasluc74669

Reputation: 1700

kendo grid selection doesn't work

this is my sample page with a simple kendo grid:

<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>

both with firefox and explorer, the row selection doesn't work.... thanks in advance!

Upvotes: 0

Views: 1242

Answers (1)

Felix
Felix

Reputation: 38102

Try to wrap your code inside DOM ready:

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

It's to ensure that your function is called once all the DOM elements of the page are ready to be used.

Upvotes: 2

Related Questions