Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using DayPilot.Web.Mvc;
- @using DayPilot.Web.Mvc.Events.Scheduler;
- @using DayPilot.Web.Mvc.Enums.Scheduler;
- @using Kalendarz_pro.Models;
- @{
- ViewBag.Title = "DayPilot Scheduler for ASP.NET MVC 4";
- }
- <script src="@Url.Content("~/Scripts/DayPilot/daypilot-all.min.js")" type="text/javascript"></script>
- @Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig
- {
- BackendUrl = Url.Action("SchedulerActive", "Scheduler"),
- EventResizeHandling = EventResizeHandlingType.CallBack,
- EventMoveHandling = EventMoveHandlingType.CallBack,
- EventDeleteHandling = EventDeleteHandlingType.CallBack,
- BusinessBeginsHour = 7,
- BusinessEndsHour = 22,
- Scale = DayPilot.Web.Mvc.Enums.TimeScale.CellDuration,
- CellDuration = 30,
- TimeHeaders = new TimeHeaderCollection
- {
- new TimeHeader(DayPilot.Web.Mvc.Enums.GroupBy.Month, "dd MMMM yyyy"),
- new TimeHeader(DayPilot.Web.Mvc.Enums.GroupBy.Hour),
- new TimeHeader(DayPilot.Web.Mvc.Enums.GroupBy.Cell)
- },
- RowHeaderWidthAutoFit = true,
- ShowNonBusiness = false,
- })
- <div>
- <ul id="external">
- @foreach (WorkScheduler x in ViewBag.Persons)
- {
- <li data-id="@x.WorkSchedulerID" data-duration="1800"><span style="cursor:move">@x.PaintballWorker.User.Username @x.PlanStart - @x.PlanEnd</span></li>
- }
- </ul>
- </div>
- <script type="text/javascript">
- $(document).ready(function makeDraggable() {
- var parent = document.getElementById("external");
- var items = parent.getElementsByTagName("li");
- for (var i = 0; i < items.length; i++) {
- var e = items[i];
- var item = {
- element: e,
- id: e.getAttribute("data-id"),
- text: e.innerText,
- duration: e.getAttribute("data-duration"),
- keepElement: true
- };
- DayPilot.Scheduler.makeDraggable(item);
- }
- })
- </script>
- <script type="text/javascript">
- function modal(url) {
- var m = new DayPilot.Modal();
- m.closed = function() {
- if(this.result == "OK") {
- dps.commandCallBack('refresh');
- }
- dps.clearSelection();
- };
- m.showUrl(url);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement