JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Scheduler Resources
Tagged: custom element, Scheduler Angular, Scheduler Blazor, Scheduler component, Scheduler element, Scheduler React, smart elements, smart framework, web component, web components
- This topic has 5 replies, 3 voices, and was last updated 2 years, 1 month ago by
admin.
-
AuthorPosts
-
February 11, 2021 at 12:19 am #101474
MilesGibson
MemberFebruary 11, 2021 at 8:42 am #101477Hristofor
MemberHi MilesGibson,
Here’s a demo that shows how to set two resources to each Scheduler event. Clicking on the radio buttons in the options area of the demo changes the order of the resources which determines the color of the events in the Scheduler. Resources are assigned to the events as key:value pairs, for example:priorityId: 2, employeeId: 2,
where the key represents the value of the resource and the value in the pair represents the id of the item from the resource dataSource property. Assigning resources to an event can also be done via the Window editor by double clicking on an event. You can read more about Scheduler Resources in the following dedicated topic.
Best Regards,
Christopher
Smart HTML Elements Team
https://www.htmlelements.comFebruary 11, 2021 at 3:48 pm #101483MilesGibson
MemberThanks for that! Does the scheduler work with a 1 event to 1 employee, or 1 event to many employee scenarios?
If I book an all-day event for the entire company of 500 people, I don’t want to have to create 500 events. Right now I have an Events table that relates to Event-Employees, that is where I am storing the employees that are assigned to that event. It looks like your scheduler accepts a List<Resource> of records, so I presume the former, but want to understand this better.
Thanks again,
MilesFebruary 12, 2021 at 8:10 am #101488Hristofor
MemberHi MilesGibson,
the Smart.Scheduler supports one resource item per event. That means that you can have any number of resources and an event can have any number of resources assigned but only one resource item per event. For example if you have a resource called employees itsdataSource
can contain a list of items where each item is a separate employee. You can assign one employee to an event since all employees are part of the same resource. However if you create the employees as separate resources instead you will be able to set multiple resources(employees) to an event, for example:dataSource = [ { label: 'Website Re-Design Plan', dateStart: new Date(year, month, date, 9, 30), dateEnd: new Date(year, month, date, 11, 30), andrew: 1, brian: 1, steven: 1 } ]; resources = [ { label: 'andrew', value: 'andrew', dataSource: [ { label: 'Andrew Olsen', id: 1 } ] }, { label: 'brian', value: 'brian', dataSource: [ { label: 'Brian Reed', id: 1 } ] }, { label: 'steven', value: 'steven', dataSource: [ { label: 'Steven Shields', id: 1 } ] } ];
Best Regards,
Christopher
Smart HTML Elements Team
https://www.htmlelements.comFebruary 12, 2021 at 5:35 pm #101493MilesGibson
MemberOk, thanks. I note in the DataSource example that the Resources all have the same Id. Is that just a typo? I will figure out how to create a view that itemizes the resources for each event the way you have done in your example. The list of resources can be pulled from the detail view, no problem.
Also: can I modify the appointment template?
FYI: The downloaded Visual Studio demo project is missing the Scheduler component from the main menu, plus the default view types don’t include Agenda, which I think is an important feature. It would be nice to see a demo component for Blazor in this project, but if I get one working, I will send it along.February 13, 2021 at 8:14 am #101494admin
KeymasterHi MilesGibson,
1. The id here represents a property of the Event in the specific resource. It is not necessary to be unique id in this case.
2. No, it is not currently possible to modify the template for Scheduler Events.
3. The blazor-demos/pages folder contains the Scheduler Blazor page.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.