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

Create Appointment window

Hi,

      i create an appointment using create appointment popup on cell click.

      Is it possible to create an appointment without popup window.
 
      I have created one form where in which i want to give all the appointment details.

      On submit of this form, the appointment should be created in the schedule control.

      Does schedule control support this functionality ?


Thanks
Saravanan .T

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team September 28, 2015 07:38 AM UTC

Hi Saravanan, 

Thanks for contacting Syncfusion Support.

Yes, the schedule control supports the creation of appointment using form (without create appointment window). It can be achieved similar to our custom window sample. In Custom window sample we had get the appointment details like start time, end time, subject, etc. through form and converted that form into window. If you wish, you can proceed with form alone but you have to convert the appointments details like start time, end time, subject, etc. into json format as we have done within the function save() in custom window sample. Kindly refer to the following code example that we have used to pass the appointments details as json format. This save() method needs to be called when the submit button of the form is pressed.

<code>


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.


Loader.
Live Chat Icon For mobile
Up arrow icon