
01..DataSource(dataSource => dataSource02. .Ajax()03. .PageSize(20)04. .ServerOperation(true)05. .Events(events => events.Error("error_handler"))y06. .Create(update => update.Action("Customer_Create", "Customer", ContentType="Application/Json")07. 08. )09. .Read(read => read.Action("Customer_Read", "Customer"))10. .Update(update => update.Action("Customer_Update", "Customer"))11. .Destroy(update => update.Action("Customer_Delete", "Customer"))12. .13. 14. )15.)@(Html.Kendo().Scheduler<iMail.Web.Models.TaskViewModel>() .Name("scheduler") .Date(DateTime.Now) .Timezone("Etc/UTC") .Views(views => { views.DayView(); views.WeekView(); views.MonthView(); views.AgendaView(agenda => agenda.Selected(true)); }) .Selectable(true) .Timezone("Etc/UTC") .Events(e => { e.Edit("onEdit"); e.Change("onChange"); }) .Editable(editable => { editable.TemplateName("_EditorTemplatePartial"); }) .DataSource(d => d .Model(m => { m.Id(f => f.TaskID); m.Field(f => f.Title).DefaultValue("No title"); m.RecurrenceId(f => f.RecurrenceID); m.Field(f => f.Priority); m.Field(f => f.TypeID); }) .Events(e => e.Error("error_handler")) .Read (read => read.Action("TasksRead", "Calendar").Data("additionalInfo").Type(HttpVerbs.Get)) .Create(create => create.Action("TasksCreate", "Calendar").Data("additionalInfo")) .Destroy(destroy => destroy.Action("TasksDestroy", "Calendar").Data("additionalInfo")) .Update(update => update.Action("TasksUpdate", "Calendar").Data("additionalInfo")) ) )<div id="AttendeeAlreadyInvited"> <div data-container-for="AlreadyInvitedID" class="k-edit-field"> @(Html.Kendo().MultiSelectFor(model => model.AlreadyInvitedID) .HtmlAttributes(new { data_bind = "value:AlreadyInvitedID" }) .DataTextField("Name") .DataValueField("ID") .BindTo(Model.Invited) ) </div></div>public class CalEmployeeLight{ public int ID; public string Name;public class TaskViewModel : Kendo.Mvc.UI.ISchedulerEvent
{
public int TaskID { get; set; } //each event have an ID.
.....
public IEnumerable<int> AlreadyInvitedID { get; set; } public ICollection<CalEmployeeLight> Invited { get; set; }
}So I'm pretty new to using this component, so I'm not very familiar with it yet.
Here's what I'm trying to do:
I have a scheduler that I'm pre-populating with a lot of tasks. I don't want the user to be able to add, delete, or update anything. However, on selecting or clicking (or double clicking, whatever works best) I want to be able to update some other value in the model that was passed into the view.
For example: When user clicks on a task at 12:00 PM I don't want to show any pop ups or anything, but I want to set Model.appontmentTime equal to the tasks start time (i.e. 12:00 PM).
Also, as a side issue, for some reason when I attach a task to an owner as listed in the resources, the task is not showing in the right color. Am I doing something wrong there?
So Far I have:
01.@(Html.Kendo().Scheduler<Humana.RetailSales.CGX.Site.TaskViewModel>()02. .Name("timeSlots")03. .Views(views => { views.WeekView(); })04. .Height(300)05. .Date(Model.appointmentCalendarRenderStartDate)06. .Height(400)07. .AllDaySlot(false)08. .MajorTick((int)Model.timeSlotInterval.TotalMinutes)09. .MinorTickCount(1)10. .Min(Model.appointmentCalendarRenderStartDate)11. .Max(Model.appointmentCalendarRenderFinishDate)12. .Resources(resource =>13. {14. resource.Add(m=> m.OwnerID)15. .Title("Owner")16. .DataTextField("Text")17. .DataValueField("Value")18. .DataColorField("Color")19. .BindTo(new[] {20. new { Text = "Many", Value = 1, color = "#003300"},21. new { Text = "Few", Value = 2, color = "#CC3300"}22. });23. })24. .DataSource(d => d25. .Model(m => {26. m.Id(f => f.TaskID);27. m.Field(f => f.Title).DefaultValue("No title");28. m.Field(f => f.OwnerID).DefaultValue(1);29. m.Field(f => f.Title).DefaultValue("No title");30. m.RecurrenceId(f => f.RecurrenceID);31. })32.33. )