It is possible to use a special mode where the user can select an exact position inside the target cell when moving the event (relative to other events in the target cell).
You can use this feature to manage priority ordering.
Moving modes
Default moving mode (moving to time cell)
Moving to a position inside a cell
You can enable this mode by using EventMoveToPosition property. The selected position will be available in EventMove event handler as e.Position.
You should store the position in a separate database field and use it for event sorting.
JavaScript
<div id="dp"></div> <script type="text/javascript"> var dp = new DayPilot.Scheduler("dp"); dp.eventMoveToPosition = true; dp.onEventMoved = function(args) { dp.message("Event moved to position: " + args.position); } // ... dp.init(); </script>
ASP.NET WebForms
.aspx
<DayPilot:DayPilotScheduler runat="server" id="DayPilotScheduler1" ... EventMoveToPosition = "true" />
.aspx.cs
protected void DayPilotScheduler1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e) { // update the db here, reload events DayPilotScheduler1.UpdateWithMessage("Event moved to position: " + e.Position); }
Demo
ASP.NET MVC
The target position is available in OnEventMove handler as e.Position (starting at index 0).
Example
View
@Html.DayPilotScheduler("dps_position", new DayPilotSchedulerConfig { BackendUrl = ResolveUrl("~/Scheduler/Backend"), ... EventMoveToPosition = true })
Backend Controller
protected override void OnEventMove(EventMoveArgs e) { // update the db here, reload events UpdateWithMessage("Moved to position: " + e.Position); }