function save() {
------------
------------
var obj = {}, temp = {}, rType;
var formelement = $("#customWindow").find("#custom").get(0);
for (var index = 0; index < formelement.length; index++) { // Here we are retrieving the values from the corresponding fields(subject,start time,etc…) from custom appointment window
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;
}
}
obj[columnName] = value; // Here the corresponding fields(subject,start time,etc…) values are stored to the variable “obj”
}
}
}
----------------
----------------
----------------
}
<code>
After storing all the values into the variable “obj”, pass the variable as an input to the public function saveAppointment() by creating the object to the schedule. Kindly refer to the following code example that we have used to pass the variable “obj” to the function saveAppointment().
<code>
function save() {
--------------
--------------
--------------
$("#customWindow").ejDialog("close");
var object = $("#Schedule1").data("ejSchedule");
object.saveAppointment(obj); // Here we are passing the variable “obj” as an input to the public function saveAppointment()
clearFields();
}
<code>
Regards,
Karthigeyan.