- Home
- Forum
- JavaScript - EJ 2
- Mobile view adds all resources to schedule
Mobile view adds all resources to schedule
I have a Scheduler working perfect fine on a desktop. It enables a user to tick on resources (and off) and they appear on the schedule. However, when i load it up on the mobile phone (latest iOS - iphone 8) it seems to load ALL resources by default into the schedule. This is very odd behaviour! see attachment

Sample code.
scheduleObj = new ej.schedule.Schedule({
width: '100%',
height: '650px',
workHours: {
start: '07:00',
end: '20:00'
},
startHour: '07:00',
endHour: '20:00',
eventSettings: { dataSource: data },
editorTemplate: '#EventEditorTemplate',
readonly: false,
showQuickInfo: false,
currentView: 'TimelineWeek',
allowVirtualScrolling: true,
rowAutoHeight: true,
group: {
resources: ['StaffLocation', 'StaffName']
},
resources: [{
field: 'StaffLocation', title: 'StaffLocation',
name: 'StaffLocation', allowMultiple: true,
textField: 'StaffLocation', idField: 'StaffLocation', colorField: 'CalendarColor'
},
{
field: 'StaffName', title: 'NewStaffName',
name: 'StaffName', allowMultiple: true,
textField: 'StaffName', idField: 'StaffName', colorField: 'CalendarColor', groupIDField: "StaffLocation"
}
],
views: viewsCollection,
SIGN IN To post a reply.
1 Reply
1 reply marked as answer
HB
Hareesh Balasubramanian
Syncfusion Team
October 19, 2020 11:34 AM UTC
Hi Paul,
Greetings from Syncfusion Support..!
We have checked the reported scenario at our end by dynamically add/remove resources which is properly working at our end. And the sample can be viewed from the following link.
|
function onChange(args) {
var value = args.event.target.getAttribute("value");
var staff = staffData.filter(function(staff) {
return staff.StaffName === value;
});
var location = locationData.filter(function(location) {
return location.StaffLocation === staff[0].StaffLocation;
});
if (args.checked) {
if (scheduleObj.resourceCollection[0].dataSource.length === 0) {
scheduleObj.addResource(location[0], "StaffLocation");
} else {
var resource = scheduleObj.resourceCollection[0].dataSource.filter(
function(resource) {
return resource.StaffLocation === location[0].StaffLocation;
}
);
if (resource.length === 0) {
scheduleObj.addResource(location[0], "StaffLocation");
}
}
scheduleObj.addResource(staff[0], "StaffName");
scheduleObj.dataBind();
} else {
scheduleObj.removeResource(value, "StaffName");
scheduleObj.dataBind();
}
} |
Please try the sample if the issue persist still, please share the following details to validate the issue at our end.
- Whether the issue replicating at initial load or when try to add/remove resources.
- Whether you are add/remove bulk of resources
- Scheduler related code
- Replicate the issue in the above sample
- Issue replicating sample(if possible)
Regards,
Hareesh
Marked as answer
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
- Marked answer
-
PL Paul Lovegrove
- Oct 16, 2020 09:36 AM UTC
- Oct 19, 2020 11:34 AM UTC