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

Problem with resources.

Hey guys!

I've been trying out the schedule widget for some time now and am really enjoying it so far. Right now i am however running into a couple of problems.

I'm trying to add multiple resources to a single appointment, but in doing so it creates an appointment per resource added. I was wondering if there is a way i can add multiple resources to a single appointment?

I am also having problems adding more the one resourcefield to the schedule. It adds the second field to the edit appointment modal but the datasource seems to be empty.
So everything works like it should when adding only one resource field. But when adding a second one the same way, it doesnt show the resources in the edit appointment field.

I am using the angular 1 version in combination with a .net core web application.

//HTML template
    <ej-schedule id="schedule" e-width="100%" e-height="1024" e-currentview="currentView" e-currentdate="setDate"
                    e-beforeAppointmentChange="beforeChangeAppointment"
                    e-beforeAppointmentCreate="beforeCreateAppointment"
                    e-beforeAppointmentRemove="beforeRemoveAppointment"
                    e-appointmentCreated="onCreateAppointment" 
                    e-appointmentRemoved="onRemoveAppointment" 
                    e-appointmentChanged="onChangeAppointment"
                    e-appointmentsettings-datasource="Appointments" 
           e-appointmentsettings-id="id" 
           e-appointmentsettings-subject="subject" 
           e-appointmentsettings-starttime="startTime"
           e-appointmentsettings-endtime="endTime" 
           e-appointmentsettings-description="description" 
           e-appointmentsettings-allday="allDay" 
           e-appointmentsettings-recurrence="recurrence" 
           e-appointmentsettings-recurrencerule="recurrenceRule"
                    e-appointmentsettings-resourcefields="actionId, vmId">
    </ej-schedule>

//JS, Then in my controller i load the resources from my API
$http.get(url,....).then(functin(result){
$("#schedule").ejSchedule("option", "resources", result.data);
}, function(error){
});

//c# code returning the resource objects, the datasources are Lists
resourceSettings.Add(new ScheduleResourceSettings { dataSource = virtualMachinesResources, text = "text", id = "id", groupId = "groupId"});
resourceSettings.Add(new ScheduleResourceSettings { dataSource = actions, text = "text", id = "id", groupId = "groupId", color = "color" });
resources.Add(new ScheduleResource { field = "vmId", title = "Virtual Machines", name = "Virtual Machines", allowMultiple = true, resourceSettings = resourceSettings[0] });
resources.Add(new ScheduleResource { field = "actionId", title = "Action", name = "Actions", allowMultiple = false, resourceSettings = resourceSettings[0] });

Thanks in advance!



2 Replies

TM Tim Mohr replied to Jasper van der Bijl June 13, 2017 02:52 AM UTC

Hey guys!

I've been trying out the schedule widget for some time now and am really enjoying it so far. Right now i am however running into a couple of problems.

I'm trying to add multiple resources to a single appointment, but in doing so it creates an appointment per resource added. I was wondering if there is a way i can add multiple resources to a single appointment?

I am also having problems adding more the one resourcefield to the schedule. It adds the second field to the edit appointment modal but the datasource seems to be empty.
So everything works like it should when adding only one resource field. But when adding a second one the same way, it doesnt show the resources in the edit appointment field.

I am using the angular 1 version in combination with a .net core web application.

//HTML template
    <ej-schedule id="schedule" e-width="100%" e-height="1024" e-currentview="currentView" e-currentdate="setDate"
                    e-beforeAppointmentChange="beforeChangeAppointment"
                    e-beforeAppointmentCreate="beforeCreateAppointment"
                    e-beforeAppointmentRemove="beforeRemoveAppointment"
                    e-appointmentCreated="onCreateAppointment" 
                    e-appointmentRemoved="onRemoveAppointment" 
                    e-appointmentChanged="onChangeAppointment"
                    e-appointmentsettings-datasource="Appointments" 
           e-appointmentsettings-id="id" 
           e-appointmentsettings-subject="subject" 
           e-appointmentsettings-starttime="startTime"
           e-appointmentsettings-endtime="endTime" 
           e-appointmentsettings-description="description" 
           e-appointmentsettings-allday="allDay" 
           e-appointmentsettings-recurrence="recurrence" 
           e-appointmentsettings-recurrencerule="recurrenceRule"
                    e-appointmentsettings-resourcefields="actionId, vmId">
    </ej-schedule>

//JS, Then in my controller i load the resources from my API
$http.get(url,....).then(functin(result){
$("#schedule").ejSchedule("option", "resources", result.data);
}, function(error){
});

//c# code returning the resource objects, the datasources are Lists
resourceSettings.Add(new ScheduleResourceSettings { dataSource = virtualMachinesResources, text = "text", id = "id", groupId = "groupId"});
resourceSettings.Add(new ScheduleResourceSettings { dataSource = actions, text = "text", id = "id", groupId = "groupId", color = "color" });
resources.Add(new ScheduleResource { field = "vmId", title = "Virtual Machines", name = "Virtual Machines", allowMultiple = true, resourceSettings = resourceSettings[0] });
resources.Add(new ScheduleResource { field = "actionId", title = "Action", name = "Actions", allowMultiple = false, resourceSettings = resourceSettings[0] });

Thanks in advance!



Hello,

I also have the same question, regarding "I'm trying to add multiple resources to a single appointment, but in doing so it creates an appointment per resource added. I was wondering if there is a way i can add multiple resources to a single appointment?"

Is there a solution for this?

Thanks,
Tim


KK Karthigeyan Krishnamurthi Syncfusion Team June 13, 2017 04:11 AM UTC

Hi Tim/Jasper, 
 
Thank you for contacting Syncfusion support. 
 
We would like to inform that currently there is no option to render single appointment for multiple resources. When an appointment is created for multiple resources, appointments will be rendered for each resource separately. In order to save/update the recurrence and split appointments correctly, multiple resource appointments were rendered separately. It is the default behavior. 
 
Regards, 
Karthigeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon