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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Remote data binding scheduler

Thread ID:

Created:

Updated:

Platform:

Replies:

146900 Aug 24,2019 09:19 PM UTC Aug 26,2019 11:40 AM UTC Blazor 1
loading
Tags: Scheduler
James Cockerill
Asked On August 24, 2019 09:19 PM UTC

I'm exploring the Scheduler and looking to bind it to a remote data source.

I'm using the Remote Data sample you supply as basis but have a few questions:

1. Do you have a demo of the server side code powering the response to that WebApiAdapter endpoint being used?

2. How are new events added or changes updated via this mechanism.
Can I bind to an event beforehand to check them? How are rejections by the server handled?

3. I wanted to add some basic authentication headers to the remote endpoint call.
I tried adding a custom header using the code below - but this gets set as a Access-Control-Request-Headers rather than a named header as I expect.

<div class="col-lg-12 control-section">
    <div class="schedule-wrapper">
        <EjsSchedule TValue="ScheduleData.AppointmentData" Width="100%" Height="650px" SelectedDate="@(new DateTime(2017, 6, 5))" Readonly="true">
            <ScheduleEventSettings TValue="ScheduleData.AppointmentData">
                <EjsDataManager Headers="@HeaderData" Url="https://example.com/api/v1/getschedule" Adaptor="@Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor"></EjsDataManager>
            </ScheduleEventSettings>
        </EjsSchedule>
    </div>
</div>

@code{
    public class Data
    {
        public string Authorization;
    };

     private Data[] HeaderData = new Data[] { new Data { Authorization = "Bearer XXX.YYY.ZZZ" } };
}

Nevitha Ravi [Syncfusion]
Replied On August 26, 2019 11:40 AM UTC

Hi James, 

Greetings from Syncfusion Support. 

Currently there is an issue with WebApiAdaptor which can be tracked from the following link and the fix will be included in our Volume 3 2019 main release expected to be rolled out at the end of September. 

In the meantime, we suggest you to use ODataV4Adaptor to perform CRUD operations and for the same we have prepared sample in which we have passed custom header for your reference. Also the rejections/failures can be tracked using OnActionFailure event. 

<EjsSchedule TValue="object" Height="550px" SelectedDate="new DateTime(2018, 5, 10)"> 
    <ScheduleEvents TValue="object" OnActionFailure="OnActionFailure"></ScheduleEvents> 
    <ScheduleEventSettings TValue="EjsDataManager"> 
        <EjsDataManager Headers="@HeaderData" Url="http://localhost:25255/odata/EventDatas" Adaptor="Adaptors.ODataV4Adaptor"></EjsDataManager> 
    </ScheduleEventSettings> 
</EjsSchedule> 
@code{ 
    public class Data 
    { 
        public string Authorization; 
    }; 
    public void OnActionFailure(ActionEventArgs<object> args) 
    { 
        //will trigger when scheduler action gets failed or interrupted and an error information will be returned. 
    } 
 
    private Data[] HeaderData = new Data[] { new Data { Authorization = "Bearer XXX.YYY.ZZZ" } }; 
} 

 


Please try the sample and let us know if you need any further assistance. 

Regards, 
Nevitha. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon