This is a migrated thread and some comments may be shown as answers.

DataSource & Resources differences clarification?

3 Answers 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 18 May 2016, 05:55 AM

Hi, just got view model displayed on calendar, now trying to add EventTemplate & display some fields from view model, but got undefined error, so i'm adding Resources. i kinda understand this Resources is the data for event, but what are the exact differences between DataSource and Resources?

Since DataSource takes view model and the fields i want to show are all in view model. is there an easy way to populate EventTemplate?

3 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 20 May 2016, 08:11 AM
Hello Alex,

I am not quite sure what do you mean by "view model". There are several demos that could help you understand better the different sources of data for RadScheduler.

Generally, the main source of data for a RadScheduler is the Appointments information. It could be passed to the RadScheduler by using Generic list, XML file and XML provider, Database provider, Entity data source, Web service, SQL data source.

Resources, on the other hand, provide additional information about appointments. For example, in a RadScheduler there could be several users that have appointments, or several rooms, where appointments are held. User is one resource type, while Room is another one. In the Appointments data, there is information about which are the user and the room for each appointment. At the same time, you could retrieve additional information for each user / room from a separate data source. When SQL data source is being used, in most cases these are three separate tables - an Appointments table, a Users table and a Rooms table which are related to each other.

I hope that the above helps you. If you have any further questions, please do not hesitate to contact us.

Regards,
Veselin Tsvetanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Alex
Top achievements
Rank 1
answered on 23 May 2016, 01:48 AM

Hi Veselin,

 

Thank you very much for the helpful reply. i was following http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/scheduler/ajax-editing

so i got task returned as JSON, 

two scenarios:

1, if i create Task view model and put fields like Assignee, Assigner into it. and want Assignee and Assigner to be displayed on a event on calendar. So Assignee, Assigner will be returned as part of JSON. How do i access them in EventTemplate? i tried but they were undefined. i noticed there is another example:

http://demos.telerik.com/aspnet-mvc/scheduler/templates

This example returns a model to the view so EventTemplate can access to fields in that model, but what to do when a JSON is returned.

2, i just want to confirm the usage of Resources - should i NOT put Assignee, Assigner into view model, but got Task data from database in Resources' datasource call? Then display Assigner, Assignee in EventTemplate? Thanks.

 

0
Veselin Tsvetanov
Telerik team
answered on 24 May 2016, 02:42 PM
Hello Alex,

As your question concerns the UI for ASP.NET MVC Scheduler and not the RadScheduler control from the ASP.NET AJAX suite, I would suggest you to post your question in the MVC forum. There is the place where you will find the right answers of your questions.

Regards,
Veselin Tsvetanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Alex
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Alex
Top achievements
Rank 1
Share this question
or