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

Scheduler with odata?

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

6 Replies

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



MR Manuel Reinacher 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



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



JK Jimmy Kim replied to Nevitha Ravi March 17, 2021 05:45 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 


Hello,
I know this is a little old but thought my question would be in this context...

Is there a way for the OData DataManager to get the appointment data with expand?
For example, if you have something like:
    public class AppointmentData
    {
        public int Id { get; set; }
        public string Subject { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public Doctor Doctor { get; set; }
        public Patient Patient { get; set; }
    }

Can the OData call within the scheduler's data manager be set up to get AppointmentData expanded to return both Doctor and Patient?

Thanks,
Jimmy


JK Jimmy Kim March 18, 2021 01:27 AM UTC

Hello,
I seem to have found my answer/solution.
Binding Query to my own Query instance passing a list of property names that I want expanded to Expand.
Basically paying more attention to this: Data Binding in Blazor DataGrid component - Syncfusion
Thanks.
Jimmy


NR Nevitha Ravi Syncfusion Team March 18, 2021 12:52 PM UTC

Hi Jimmy, 

We are happy that your issue has been resolved at your end, please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Live Chat Icon For mobile
Up arrow icon