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

Remote data binding scheduler

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" } };
}

1 Reply

NR Nevitha Ravi Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon