This topic contains 5 replies, has 3 voices, and was last updated by Avatar admin 7 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #101474
    Avatar
    MilesGibson
    Participant

    Has anyone used the Resources feature of the Scheduler? I am happy to see that it is possible to have multiple resources against a given calendar event, but the demos don’t cover this.

    TIA,

    Miles

    #101477
    Avatar
    Hristofor
    Participant

    Hi 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.com

    #101483
    Avatar
    MilesGibson
    Participant

    Thanks 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,

    Miles

    #101488
    Avatar
    Hristofor
    Participant

    Hi 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 its dataSource 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.com

    #101493
    Avatar
    MilesGibson
    Participant

    Ok,  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.

    #101494
    Avatar
    admin
    Keymaster

    Hi 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/

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.