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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Appointments are cleared on batch add/update

Thread ID:

Created:

Updated:

Platform:

Replies:

129447 Mar 18,2017 04:21 PM UTC Mar 22,2017 04:33 AM UTC ASP.NET MVC 4
loading
Tags: Schedule
Ajay
Asked On March 18, 2017 04:21 PM UTC

Hi,

We are using batch add/edit functionality for the schedule control and it was working fine. But after recent version upgrades whenever a new appointment is added or existing appointment is edited the schedule control clears all existing appointments.

We need to refresh the page to view the updated appointments.

Sample Code:

 public async Task<ActionResult> Batch([FromBody] CalendarModel model)
{
            // Executes while adding an appointment
            if (param.action == "insert" || (param.action == "batch" && param.added != null))
            {
                if (param.action ==  "insert")
                {                
                    //Save to DB
                    _repository.SaveAppointment(model);
                }
                else
                {
                    foreach (var appointment in param.added)
                    {
                      //Save to DB
                    _repository.SaveAppointment(model);
                    }
                }

            //Get Appointments
            var appointments = _repository.GetAppointments().ToList(); //Calls the GET Method that returns all appointments
            }
}

Could you please help us?

Thanks,
Ajay.

Ajay
Replied On March 18, 2017 05:01 PM UTC

Hi,

Please merge this with this thread. I'm facing the same issue.


Thanks,
Ajay.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 20, 2017 08:39 AM UTC

Hi Ajay 
  
Thank you for contacting Syncfusion support.  
  
We suspect that appointment Start/EndTime are not in correct format after performing CRUD operation which could be the cause for the issue. Kindly use the below code example to overcome the reported issue.  
  
<Code>  
<ej-schedule id="Schedule1" width="100%" height="525px" create="onCreate" current-date="new DateTime(2014, 12, 5)">  
    <e-appointment-settings apply-time-offset="false" id="Id" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"'>  
        <e-datamanager url="Home/GetData" crud-url="Home/Batch" adaptor="UrlAdaptor"></e-datamanager>  
    </e-appointment-settings>  
</ej-schedule>  
  
<script >  
    function onCreate(args) { // this function will be called during the initial load of the Schedule  
        Date.prototype.parseISO8601 = function (date) {  
            return (typeof (date) === 'string') ? date.indexOf("Date") != -1 ? new Date(parseInt(date.match(/\d+/).toString())) : date.indexOf("T") != -1 ? new Date(date) : new Date(date.replace(/-/g, "/")) : new Date(date);  
        };  
    }  
</script>  
</Code>  
  
Regards,  
Karthigeyan  
 


Ajay
Replied On March 21, 2017 08:53 PM UTC

Thank you very much. Your fix works perfectly.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 22, 2017 04:33 AM UTC

 
We are happy that your issue has been resolved. 
 
Please let us know if you need further assistance. 
 
Regards, 
Karthigeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;