Many thanks for a speedy response I have amended this in the controller now but still no data returned to the front end. I can debug it and see that data is being returned from Controller - ia have attached the code of my view incase it is something - it worked using the example of dataadapter and datatables but i want to mone away from that
Thanks again
Controller :
Public Function Backend() As ActionResult
Return New Dpm().CallBack(Me)
End Function
Public Class Dpm
Inherits DayPilotMonth
Protected Overrides Sub OnInit(ByVal e As DayPilot.Web.Mvc.Events.Month.InitArgs)
Dim db2 = New R32_LiveEntities1
Dim Events As List(Of SSC_Identify_Holidays_By_Line_Manger_Result)
Events = db2.ExecuteStoreQuery(Of SSC_Identify_Holidays_By_Line_Manger_Result)("SSC_Identify_Holidays_By_Line_Manger").ToList
DataIdField = "RowNum"
DataTextField = "Employee"
DataStartField = "Annual_Leave_Day"
DataEndField = "Annual_Leave_Day"
Update()
End Sub
View :
@imports DayPilot.Web.Mvc
@imports DayPilot.Web.Mvc.Enums
@imports DayPilot.Web.Mvc.Events.Month
@imports DayPilot.Web.Mvc.DayPilotMonth
<select id="dropdown" onchange="this.form.submit();">
@Code
Dim first As DateTime = New DateTime(DateTime.Today.Year, DateTime.Today.Month, 1)
For i As Integer = 0 To 12
Dim d = first.AddMonths(i)
@<option value="@d.ToString("s") %>">@d.ToString("MMMM yyyy")</option>
Next
End Code
</select>
<h2 style="margin:0px;padding:0px;">Calendar Of Holidays</h2>
<div style="margin-bottom: 10px;"></div>
<script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/common.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/month.js")" type="text/javascript"></script>
<div id="dpm">
<script type="text/javascript">
var dp;
$(document).ready(function () {
dp = $("#dpm").daypilotMonth({
backendUrl: '@Url.Content("~/Home/Backend")',
});
});
</script>
<script type="text/javascript">
$("#dropdown").change(function() {
var selected = $(this).val();
dpm.commandCallBack("navigate", {start: selected});
});
</script>