Pre-populating the Location Field On AppointmentWindowOpen

I'm creating a procedure that will create an appointment in the Scheduler based upon a link from an address. So, when the user clicks on the scheduler to create the new appointment, I'd like the Location Field (it is enabled) pre-filled with the address. The address itself is contained in an asp.net hiddenfield which I can access, but I cannot seem to populate the Location field (or any other field I've tried, such as the Subject field). I have tested using an alert - the value from the hiddenfield is being picked up correctly. What am I doing wrong?

function onAppointmentOpen(args) {
           
            //var loc = document.getElementById('<%= hiddenAddressID.ClientID%>').value;
            this._appointmentAddWindow.find(".location").val(loc );

          // OR //

   $("#location").val(loc);
        }

1 Reply

AA Arulraj A Syncfusion Team September 21, 2018 12:52 PM UTC

Hi Hywel, 

Thanks for contacting Syncfusion support. 

We have reset the field values after the AppointmentWindowOpen event is triggered internally which is the cause for the reported problem. To overcome the issue, if your requirement is to customize the location field alone add custom field in default appointment window by referring the below code.  

function onAppointmentOpen(args) { 
    this._appointmentAddWindow.find("#" + this._id + "description").css("display", "none"); // it will hide the default textarea description field 
    if ($(".customfields").length == 0) { 
        var customDesign = "<tr class='customfields'><tr class='dropdownfield'><td class='e-textlabel'>Decsription</td><td><input  id='customdescription' type='text' id='Desc' name='Decsription' class='appDesc' /></td></tr>"; 
        $("." + this._id + "parrow").before(customDesign); 
    } 
    if (!ej.isNullOrUndefined(args.appointment)) { 
        // if double clicked on the appointments, retrieve the custom field values from the appointment object and fills it in the appropriate fields. 
        $('#customdescription').val(args.appointment.Decsription); 
    } 
    else { 
        // if double clicked on the cells, clears the field values. 
        $('#customdescription').val('Default Value'); 
    } 
} 

Else if your requirement is to add multiple custom fields, you can use custom appointment window. Please refer the following online sample link.   

 
Arulraj A 


Loader.
Up arrow icon