Files
jube-fork/Jube.App/wwwroot/kendo/examples/scheduler/signalr.html
2022-11-04 13:24:24 +02:00

176 lines
6.6 KiB
HTML
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Binding to SignalR</title>
<meta charset="utf-8">
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
<script src="../../js/jquery.min.js"></script>
<script src="../../js/jszip.min.js"></script>
<script src="../../js/kendo.all.min.js"></script>
<script src="../content/shared/js/console.js"></script>
<script>
</script>
</head>
<body>
<a class="offline-button" href="../index.html">Back</a>
<div id="example" class="k-content">
<div id="scheduler" style="margin-bottom:20px"></div>
<span id="notification"></span>
<script src="../content/web/integration/jquery.signalr-1.1.3.min.js"></script>
<script>
var hub,
hubStart;
$(function () {
var hubUrl = "https://demos.telerik.com/kendo-ui/service/signalr/hubs";
var connection = $.hubConnection(hubUrl, { useDefaultPath: false });
hub = connection.createHubProxy("meetingHub");
hubStart = connection.start({ jsonp: true });
$("#notification").kendoNotification({
width: "100%",
position: {
top: 0,
left: 0
}
});
})
</script>
<script>
$(function() {
$("#scheduler").kendoScheduler({
date: new Date("2013/6/13"),
startTime: new Date("2013/6/13 07:00 AM"),
height: 600,
views: [
"day",
{ type: "week", selected: true },
"month",
"agenda",
"timeline"
],
timezone: "Etc/UTC",
dataSource: {
type: "signalr",
push: function (e) {
var notification = $("#notification").data("kendoNotification");
notification.success(e.type);
},
transport: {
signalr: {
hub: hub,
promise: hubStart,
server: {
read: "read",
create: "create",
update: "update",
destroy: "destroy"
},
client: {
read: "read",
create: "create",
update: "update",
destroy: "destroy"
}
}
},
schema: {
model: {
id: "ID",
fields: {
ID: {
editable: false,
type: "string",
defaultValue: null
},
roomId: {
type: "number",
defaultValue: null,
from: "RoomID"
},
attendees: {
type: "object",
from: "Attendees"
},
start: {
type: "date",
from: "Start"
},
end: {
type: "date",
from: "End"
},
title: {
type: "string",
from: "Title"
},
description: {
type: "string",
from: "Description"
},
recurrenceID: {
type: "number",
from: "RecurrenceID"
},
recurrenceRule: {
type: "string",
from: "RecurrenceRule"
},
recurrenceException: {
type: "string",
from: "RecurrenceException"
},
isAllDay: {
type: "boolean",
from: "IsAllDay"
},
startTimezone: {
type: "string",
from: "StartTimezone"
},
endTimezone: {
type: "string",
from: "EndTimezone"
}
}
}
}
},
resources: [
{
field: "roomId",
dataSource: [
{ text: "Meeting Room 101", value: 1, color: "#6eb3fa" },
{ text: "Meeting Room 201", value: 2, color: "#f58a8a" }
],
title: "Room"
},
{
field: "attendees",
dataSource: [
{ text: "Alex", value: 1, color: "#f8a398" },
{ text: "Bob", value: 2, color: "#51a0ed" },
{ text: "Charlie", value: 3, color: "#56ca85" }
],
multiple: true,
title: "Attendees"
}
]
});
});
</script>
</div>
</body>
</html>