|
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.CurrentDate(new DateTime(2016, 10, 29))
.ScheduleClientSideEvents(evt =>
evt.AppointmentWindowOpen("onAppointmentWindowOpen"))
.AppointmentSettings(fields => fields.Datasource(ViewBag.datasource)
.ApplyTimeOffset(false)
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule"))
)
<script>
function onAppointmentWindowOpen(args) {
if (this._appointmentAddWindow.find("#EventType").length == 0) {
$("<tr><td class='e-leftfields e-textlabel'>Event Type:</td><td class='e-rightfields' colspan='3'><input type='text' id='EventType'/></td></tr>").insertAfter(this._appointmentAddWindow.find("." + this._id +"parrow"));
this._appointmentAddWindow.find("#EventType").ejAutocomplete({
dataSource: [
{ text: "Public Event", value: "Public Event" },
{ text: "Holiday", value: "Holiday" },
{ text: "Maintenance", value: "Maintenance" },
{ text: "Commercial Event", value: "Commercial Event" },
{ text: "Family Event", value: "Family Event" }
],
showPopupButton: true,
height: 30,
width: 300,
popupHeight: 200,
popupWidth: 300,
});
}
if (!ej.isNullOrUndefined(args.appointment) && !ej.isNullOrUndefined(args.appointment.EventType)) {
this._appointmentAddWindow.find("#EventType").ejAutocomplete("option", "value", args.appointment.EventType); //to populate event value from an appointment
}
else {
this._appointmentAddWindow.find("#EventType").ejAutocomplete("option", "value", "");
}
}
</script> |
|
function onScheduleCreate(args) {
if (ej.isNullOrUndefined(this._appointmentAddWindow)) this._renderAppointmentWindow();//to render appointment window
if (this._appointmentAddWindow.find("#EventType").length == 0) {
$("<tr><td class='e-leftfields e-textlabel'>Event Type:</td><td class='e-rightfields' colspan='3'><input type='text' id='EventType'/></td></tr>").insertAfter(this._appointmentAddWindow.find("." + this._id + "parrow"));
this._appointmentAddWindow.find("#EventType").ejAutocomplete({
dataSource: [
{ text: "Public Event", value: "Public Event" },
{ text: "Holiday", value: "Holiday" },
{ text: "Maintenance", value: "Maintenance" },
{ text: "Commercial Event", value: "Commercial Event" },
{ text: "Family Event", value: "Family Event" }
],
showPopupButton: true,
height: 30,
width: 300,
popupHeight: 200,
popupWidth: 300,
});
}
} |