Hello,
Is there any way I can use a custom class instead of the appointment class for a schedule control?
Or at least to extend current appointment class properties?
Below is my schedule, but it doesn't work if the object that comes in the model has for example for subject a field called StartDate instead of StartTime. I also need to add a bunch of other properties, but i cannot find how ...
<div class="container-fluid">
@(Html.EJ().Schedule("Schedule")
.Width("100%")
.Height("525px")
.Views(views)
.CurrentView(CurrentView.Agenda)
.CurrentDate(new DateTime(2018, 8, 20))
.FirstDayOfWeek(DayOfWeek.Monday)
.IsResponsive(true)
.ContextMenuSettings(contextMenu => contextMenu.Enable(false))
.ScheduleClientSideEvents(e => e.AppointmentWindowOpen("onAppointmentWindowOpen").QueryCellInfo("OnCheckInfo"))
.ShowWeekend(false)
.AppointmentSettings(fields => fields.Datasource(Model)
.Id("Id")
.Subject("Name")
.StartTime("StartDate")
.EndTime("EndDate")
.Description("Description")
.AllDay("IsAllDay")
.Recurrence("IsRecurrence")
.RecurrenceRule("RecurrenceRule"))
)
</div>
Regards,
Cristina
| public class DataSource { private int id; private string name; private string description; private DateTime startDate; private DateTime endDate; private bool isAllDay; private bool isRecurrence; private string recurrenceRule; // addinal fields private DateTime orderDate; private bool isDelivered; private string productName; private int customerMobileNo; public DataSource(int id, string name, string description, DateTime startDate, DateTime endDate, bool isAllDay, bool isRecurrence, string recurrenceRule, DateTime orderDate, bool isDelivered, string productName, int customerMobileNo) { this.id = id; this.name = name; this.description = description; this.startDate = startDate; this.endDate = endDate; this.isAllDay = isAllDay; this.isRecurrence = isRecurrence; this.recurrenceRule = recurrenceRule; // addional fields this.orderDate = orderDate; this.isDelivered = isDelivered; this.productName = productName; this.customerMobileNo = customerMobileNo; } public int Id { get { return id; } set { id = value; } } public string Name { get { return name; } set { name = value; } } public string Description { get { return description; } set { description = value; } } public DateTime StartDate { get { return startDate; } set { startDate = value; } } public DateTime EndDate { get { return endDate; } set { endDate = value; } } public bool IsAllDay { get { return isAllDay; } set { isAllDay = value; } } public bool IsRecurrence { get { return isRecurrence; } set { isRecurrence = value; } } public string RecurrenceRule { get { return recurrenceRule; } set { recurrenceRule = value; } } // addional fields public DateTime OrderDate { get { return orderDate; } set { orderDate = value; } } public bool IsDelivered { get { return isDelivered; } set { isDelivered = value; } } public string ProductName { get { return productName; } set { productName = value; } } public int CustomerMobileNo { get { return customerMobileNo; } set { customerMobileNo = value; } } } |