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.Month("dp"); dp.eventMoveToPosition = true; dp.onEventMoved = function(args) { dp.message("Event moved to position: " + args.position); } // ... dp.init(); </script>
ASP.NET WebForms
.aspx
<DayPilot:DayPilotMonth runat="server" id="DayPilotMonth1" ... EventMoveToPosition = "true" />
.aspx.cs
protected void DayPilotMonth1_EventMove(object sender, EventMoveEventArgs e) { // update the db here, reload events DayPilotMonth1.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.DayPilotMonth("dpm", new DayPilotMonthConfig { BackendUrl = ResolveUrl("~/Month/Backend"), ... EventMoveToPosition = true })
Backend Controller
protected override void OnEventMove(EventMoveArgs e) { // update the db here, reload events UpdateWithMessage("Moved to position: " + e.Position); }