The client-side AfterRender event is fired every time the Calendar rendering/updating is completed.
It has access to custom data passed to Update method on the server side.
JavaScript
This event only fires during the initial load.
<div id="dp"></div> <script type="text/javascript"> var dp = new DayPilot.Calendar("dp"); dp.onAfterRender = function (args) { console.log("Rendering finished."); }; // ... dp.init(); </script>
See also:
ASP.NET WebForms
<daypilot:DayPilotCalendar id="DayPilotCalendar1" runat="server" ... AfterRenderJavaScript="afterRender(data, isCallBack);" /> <script type="text/javascript"> function afterRender(data, isCallBack) { if (isCallBack) { console.log("Callback finished. Custom data received: " + data); } } </script>
ASP.NET MVC
@Html.DayPilotCalendar("dpc", new DayPilotCalendarConfig { BackendUrl = ResolveUrl("~/Calendar/Backend"), ... AfterRenderJavaScript = "afterRender(data, isCallBack)" }) <script type="text/javascript"> function afterRender(data, isCallBack) { if (isCallBack) { console.log("Callback finished. Custom data received: " + data); } } </script>