Hi,
i am creating custom appointment screen using the code
.ScheduleClientSideEvents(evt => evt.AppointmentWindowOpen("onAppointmentWindowOpen"))
and to save the data below function is used.
function save() {
if ($("#subject").val().trim() == "") {
$("#subject").addClass("error");
return false;
}
var obj = {}, temp = {}, rType;
formelement = $("#customWindow").find("#custom").get(0);
for (var index = 0; index < formelement.length; index++) {
var columnName = formelement[index].name, $element = $(formelement[index]);
if (columnName != undefined) {
if (columnName == "")
columnName = formelement[index].id.replace(this._id, "");
if (columnName != "" && obj[columnName] == null) {
var value = formelement[index].value;
if (columnName == "Id" && value != "")
value = parseInt(value);
if ($element.hasClass("e-datetimepicker"))
value = new Date(value);
if (formelement[index].type == "checkbox")
value = formelement[index].checked;
if (columnName == "freq") {
if (formelement[index].type == "select-one") {
rType = document.getElementById("rType");
temp[columnName] = rType.options[rType.selectedIndex].value;
}
}
alert(columnName + " value " + value);
obj[columnName] = value;
}
}
}
if (obj.Recurrence) {
if (temp.freq.toUpperCase() == "DAILY")
obj["RecurrenceRule"] = "FREQ=DAILY;INTERVAL=1;COUNT=5";
else if (temp.freq.toUpperCase() == "WEEKLY")
obj["RecurrenceRule"] = "FREQ=WEEKLY;BYDAY=MO,WE,TH;INTERVAL=1;COUNT=10";
else if (temp.freq.toUpperCase() == "MONTHLY")
obj["RecurrenceRule"] = "FREQ=MONTHLY;BYMONTHDAY=" + obj.StartTime.getDate() + ";INTERVAL=1;COUNT=5";
else if (temp.freq.toUpperCase() == "YEARLY")
obj["RecurrenceRule"] = "FREQ=YEARLY;BYMONTHDAY=" + obj.StartTime.getDate() + ";BYMONTH=" + (obj.StartTime.getMonth() + 1) + ";INTERVAL=1;COUNT=3";
}
else
obj["RecurrenceRule"] = null;
$("#customWindow").ejDialog("close");
var object = $("#Schedule1").data("ejSchedule");
alert("Before save");
object.saveAppointment(obj);
alert("After save");
clearFields();
}
but when i create the appointment, the appointment is shown in the scheduler control but not persisted in the table.
could you suggest me the solution for this.
Thanks
Saravanan .T