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

Scheduler with odata?

Thread ID:

Created:

Updated:

Platform:

Replies:

147369 Sep 8,2019 01:36 AM UTC Sep 10,2019 12:40 PM UTC Blazor 3
loading
Tags: Scheduler
Manuel Reinacher
Asked On September 8, 2019 01:36 AM UTC

Hello,

Does the Scheduler support odata?

I tried the following code, but I get an exception:



<EjsSchedule TValue="AppointmentData" ModelType="@(new AppointmentData())" Height="650px">
    <EjsDataManager Url="https://ej2services.syncfusion.com/development/web-services/odata/events" Adaptor="Adaptors.ODataV4Adaptor" CrossDomain="true"></EjsDataManager>
</EjsSchedule>

@code{
    public class AppointmentData
    {
        public int Id { get; set; }
        public string Subject { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
    }
}


regards Manuel

Nevitha Ravi [Syncfusion]
Replied On September 9, 2019 11:51 AM UTC

Hi Manuel, 

Greetings from Syncfusion Support. 

Yes, we have provided OData adaptor support to Blazor Schedule component. We have checked with the shared code snippet and found that you have missed to include ScheduleEventSettings tag helper. The tag is mandatory to render the Schedule component with Data Manager.  

Please find the modified code snippet:  
@using Syncfusion.EJ2.Blazor 
@using Syncfusion.EJ2.Blazor.Schedule 
@using Syncfusion.EJ2.Blazor.Data 
 
 
<EjsSchedule TValue="AppointmentData" Height="550px" SelectedDate="new DateTime(2018, 5, 10)"> 
    <ScheduleEventSettings TValue="AppointmentData"> 
        <EjsDataManager Url="http://localhost:25255/odata/EventDatas" Adaptor="Adaptors.ODataV4Adaptor"></EjsDataManager> 
    </ScheduleEventSettings> 
</EjsSchedule> 
@code{ 
    public class AppointmentData 
    { 
        public int Id { get; set; } 
        public string Subject { get; set; } 
        public string Location { get; set; } 
        public DateTime StartTime { get; set; } 
        public DateTime EndTime { get; set; } 
        public string Description { get; set; } 
        public bool IsAllDay { get; set; } 
        public string RecurrenceRule { get; set; } 
        public string RecurrenceException { get; set; } 
        public Nullable<int> RecurrenceID { get; set; } 
    } 
} 

We have prepared a CRUD sample using ODataV4Adaptor which can be downloaded from the following link. 

Note: The shared sample prepared using.NET Core 3.0 Preview9. 

Regards, 
Nevitha 


Manuel Reinacher
Replied On September 9, 2019 06:25 PM UTC

Hello Nevitha,

Thank you very much. The control is now sending an request. 

I can now use the schedule component with the backend you provided in your project.

It would be nice if the component will support odata in the future. In my opinion the scheduler
does not really use odata right now.

Because a request looks like this:

http://localhost:5000/api/event/?StartDate=2019-09-07T22:00:00.000Z&EndDate=2019-09-14T22:00:00.000Z

but in odata it should look like this:

http://localhost:5000/api/event/?$count=true&$filter=(StartDate%20gt%202019-09-02T00:00:00.000Z)%20and%20(EndDate%20lt%202019-09-03T00:00:00.000Z)

The Grid for example is using the filter parameter from odata.


regards Manuel


Nevitha Ravi [Syncfusion]
Replied On September 10, 2019 12:40 PM UTC

Hi Manuel, 

Thanks for your opinion. We have added StartDate and EndDate as optional parameter through Custom Query Action of OData.  

We will consider your opinion and make complete filter using where query in future development.  

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