这是一个非常基本的问题 - 如何创建Kendo UI控件/如何让Kendo小部件显示?
例如。我试过这个日历控件。 我将js文件复制到js文件夹
并链接了2个样式文件。
当我有以下脚本来实例化日历小部件
时<script>
$(document).ready(function () {
$("#cal").kendoCalendar({
value: new Date(),
min: new Date(1950, 0, 1),
max: new Date(2049, 11, 31)
});
});
</script>
但是我在.kendoCalendar()实例化日历时遇到错误。
有人可以帮我这个吗?
提前致谢。
答案 0 :(得分:1)
您只需要包含:
<!-- Kendo UI Web styles-->
<link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css"/>
<link href="styles/kendo.default.min.css" rel="stylesheet" type="text/css"/>
<!-- jQuery scripts-->
<script src="js/jquery.min.js" type="text/javascript"></script>
<!-- Kendo UI Web scripts-->
<script src="js/kendo.web.min.js" type="text/javascript"></script>
kendo.web.min.js
包含所有小部件。包括这个就足够了。
你没有提到jquery.min.js
。检查你是否也有它。
这是HTML:
<div id="cal" name="cal"/>
编辑:使用文件管理远程CDN的完整示例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>OnaBai - KendoUI Calendar example</title>
<!-- Kendo UI Web styles-->
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.common.min.css" rel="stylesheet"/>
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.default.min.css" rel="stylesheet"/>
<!-- Kendo UI Web scripts-->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.web.min.js"></script>
<!-- Initialize Form Elements -->
<script type="text/javascript">
$(document).ready(function () {
$("#cal").kendoCalendar({
value: new Date(),
min : new Date(1950, 0, 1),
max : new Date(2049, 11, 31)
});
});
</script>
</head>
<body>
<div id="cal" name="cal"/>
</body>
</html>