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

How to add extra fields to the appointment editor

Hi Support:

We need to add more fields to your default appointment editor.

Do you have some kind of documentation to do that for the ASP.NET Core schedule control.

Thanks

David

7 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team December 23, 2016 10:52 AM UTC

Hi David,   
   
Thank you for contacting Syncfusion support.   
  
If your requirement is to include more custom fields in an appointment window, then kindly use our custom window feature and we strongly recommend not to customize the default appointment window with more number of custom fields. Complete UG documentation (like JS platform) for ASP.Net Core is in progress and it will be updated in our upcoming release. We have attached the word document (for your reference) which depicts the steps and code example to customize the default window and to use the custom window which can be download from the below location.   
 
Regards,   
Karthigeyan   
 



DS dsapo December 23, 2016 06:44 PM UTC

HI Karthigeyan :

I am testing adding a custom field to the existing window, but the problem that I have is to display the new value (Phone) that is retrieved from the SQL Database.  I know that you told me to create a whole new window, but for the sake of simplicity I am trying to add just a field to the default window.

The problem is that the new property Phone is null in the view.

 function onAppointmentOpen(args) {
        alert(args.appointment.Phone);
}

This is the schedule definion:

<ej-schedule id="Schedule1" width="100%" height="525px" show-quick-window="false" current-date="DateTime.Now" 
              views="@views" create="onCreate" appointment-window-open="onAppointmentOpen">
  
    <e-appointment-settings id="Id" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' 
                            all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"' r >
        <e-datamanager url="Home/GetData" crud-url="Home/Batch" adaptor="UrlAdaptor"></e-datamanager>
    </e-appointment-settings>

</ej-schedule>


The GetData action is returning the Phone value, but what should I do to be available in the view.

Appreciate all your help.



David
 


DS dsapo December 23, 2016 07:47 PM UTC

Hi Karthigeyan:

I found my issue.  The solution was to include the name property in the html fragment as follows:

function onCreate(args) {
        var customDesign = "<tr class='customfields'><td class='e-textlabel'>Phone</td><td><input class='county' type='text' name='Phone'/></td></tr>";
        $("." + this._id + "parrow").after(customDesign);
    }


With this attribute, now the http post includes my new custom field (Phone) in the action controller.

Thanks again for your guidance.

David


SE Sellakumar Syncfusion Team December 27, 2016 04:40 PM UTC

Hi David, 
  
Thanks for your update and we are happy to hear that you found a solution. 
  
Apart from the above solution, you can also assign the additional field name from the database to the appointmentSettings field set as shown below within the onCreate function, so that the value of that additional field can be directly accessed within "appointmentWindowOpen" event. 
  
<code> 
  
function onCreate(args) { 
var customDesign = "<tr class='customfields'><td class='e-textlabel'>Phone</td><td><input class='county' type='text' name='Phone'/></td></tr>"; 
$("." + this._id + "parrow").after(customDesign); 
this._appointmentSettings["Phone"] = "Phone"; // Here, the yellow highlighted keyword needs to be replaced with the additional field name added in the database. 
} 
function onAppointmentWindow(args) { 
var schObj = $("#Schedule1").ejSchedule("instance"); 
schObj._appointmentAddWindow.find(".county").val(args.appointment.Phone); 
} 
  
</code> 
  
Kindly try this if it helps and revert us, if you need any further assistance on this. 
  
Regards, 
Sellakumar K


DS dsapo December 29, 2016 03:46 PM UTC

Hi Sellakumar:

We decided to use the other approach to create a new custom appointment window rather than expanding the default window.

But when I click the save button, the Batch action method receives null in the EditParams parameter.

Any idea what could I be missing here.

Thanks again

David


DS dsapo December 29, 2016 05:21 PM UTC

Hi again:

We found the problem.  It was caused by the Id property value in a different casing.

Case closed.

David


KK Karthigeyan Krishnamurthi Syncfusion Team January 2, 2017 05:34 AM UTC

Hi David, 
  
Thanks for your update and we are happy to hear that you found a solution.  
 
Kindly let us know, if you need any further assistance. 
 
 
Regards, 
Karthigeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon