We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

custom appointment screen

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


1 Reply

SK Sarath Kumar P K Syncfusion Team September 28, 2015 11:32 AM UTC

Hi Saravanan,

Thanks for contacting Syncfusion support.

We have prepared the sample to meet your requirement “Adding the appointments using custom window and need to maintain in table” which can be downloaded from the following location:
http://www.syncfusion.com/downloads/support/forum/120558/ze/ScheduleCRUD1713850675
In the above sample we have used the CRUD operations to maintain the appointments in table and shown in scheduler. Please try the above provided sample and let us know if you need further assistance.

Regards,
Sarath Kumar P K
 

Loader.
Live Chat Icon For mobile
Up arrow icon