Kendo UI for jQuery 是一套强大的jQuery UI组件库,用于创建高度交互的web应用程序。以下是一些使用Kendo UI创建的常见组件的示例代码。
- 日期选择器(DatePicker)
$("#datepicker").kendoDatePicker();
- 下拉列表(DropDownList)
$("#dropdownlist").kendoDropDownList();
- 编辑器(Editor)
$("#editor").kendoEditor();
- 网格视图(GridView)
$("#grid").kendoGrid({
columns: [
{ field: "name", title: "Name" },
{ field: "age", title: "Age" }
]
});
- 菜单(Menu)
$("#menu").kendoMenu();
- 导航条(NavBar)
$("#navbar").kendoNavBar();
- 调度器(Scheduler)
$("#scheduler").kendoScheduler({
date: new Date("2013/6/13"),
startTime: new Date("2013/6/13 07:00 AM"),
height: 600,
views: [
"day",
{ type: "workWeek", selected: true },
"week",
"month"
],
timezone: "Etc/UTC",
dataSource: {
batch: true,
transport: {
read: {
url: "https://demos.telerik.com/kendo-ui/service/tasks",
dataType: "jsonp"
},
update: {
url: "https://demos.telerik.com/kendo-ui/service/tasks/update",
dataType: "jsonp"
},
create: {
url: "https://demos.telerik.com/kendo-ui/service/tasks/create",
dataType: "jsonp"
},
destroy: {
url: "https://demos.telerik.com/kendo-ui/service/tasks/destroy",
dataType: "jsonp"
},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
model: {
id: "taskId",
fields: {
taskId: { from: "TaskID", type: "number" },
ti