如何在數據綁定到調度器後從Kendo調度器中檢索數據。在網格數據綁定後,我設置了一個JavaScript函數來觸發。當這個javascript函數觸發時,我需要從網格中獲取數據源。綁定後得到kendo調度器數據源
@(Html.Kendo().Scheduler<Optic_Freedom.Areas.Scheduling.Models.CalendarViewModel>()
.Name("scheduler")
.Date(new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day))
.StartTime(new DateTime(2013, 6, 13, 07, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 23, 00, 00))
.Editable(false)
.Height(900)
.Events(e=> e.DataBound("someFunction"))
.EventTemplate(
"<div style='font-size:8pt;'>#= kendo.toString(title) # - #= kendo.toString(start, 'HH:mm') # - #= kendo.toString(end, 'HH:mm') # (#= kendo.toString(TotalPersonnel) #)</div>"
)
.Views(views =>
{
views.DayView();
views.MonthView(month => month.Selected(true).DayTemplate("<div id=\"DayClass\" style='float:left'><span class=\"theDate\">#= kendo.toString(date, 'dd')#</span> - (<span id=\"PersonnelDayCount\"/>)</div>"));
views.AgendaView(a =>a.Title("Event List"));
})
.DataSource(d => d
.Model(m => m.Id(f => f.Id))
.Read("GetSchedule", "ScheduleHome")
)
)
--javascript函數試圖獲取數據
function someFunction(e) {
var model = $("#scheduler").data("kendoScheduler");
-- can't get the model data
}
我需要什麼就擺在someFunction(E)來獲取數據?