Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143317 | Mar 13,2019 08:39 PM UTC | Mar 15,2019 09:26 AM UTC | ASP.NET MVC - EJ 2 | 1 |
![]() |
Tags: Schedule |
@Html.EJS().Schedule("schedule").SelectedDate(new DateTime(2018, 2, 15)).Width("100%").Height("550px").EventSettings(e => e.DataSource(ViewBag.appointments)).PopupOpen("onPopupOpen").EventClick("onEventClick").CellClick("onCellClick").Render()
function onCellClick(args) {
args.cancel = true;
this.editorTemplate = "#CellEditorTemplate";
this.dataBind();
this.openEditor(this.activeCellsData, 'Add');
}
function onEventClick(args) {
args.cancel = true;
this.editorTemplate = "#EventEditorTemplate";
this.dataBind();
this.openEditor(this.activeEventData.event, 'Save');
}
function onPopupOpen(args) {
if (args.type === 'Editor') {
var statusElement = args.element.querySelector('#EventType');
if (!ej.base.isNullOrUndefined(statusElement)) {
if (!statusElement.classList.contains('e-dropdownlist')) {
var dropDownListObject = new ej.dropdowns.DropDownList({
placeholder: 'Select a status', value: statusElement.value,
dataSource: ['New', 'Requested', 'Confirmed']
});
dropDownListObject.appendTo(statusElement);
statusElement.setAttribute('name', 'EventType');
}
}
var startElement = args.element.querySelector('#StartTime');
if (!startElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date() }, startElement);
}
var endElement = args.element.querySelector('#EndTime');
if (!endElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date() }, endElement);
}
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.