Hi,
I've had to come up with my own implementation logic to determine the groupIndex for an event (target isn't always available depending on how the appointment is generated). This has been working well, but for some reason getGroupIndexFromEvent returns 0 on mobile devices.
My full code for the groupIndex, e.g. in the popupOpen event:
var groupIndex = 0;
if (hasOwnProperty(args.data, "groupIndex")) {
groupIndex = args.data.groupIndex;
} else {
if (Array.isArray(args.data.ResourceId)) {
// this is were it fails on mobiles:
let testObject = {
ResourceGroupId: args.data.ResourceGroupId,
ResourceId: args.data.ResourceId[0]
};
console.log(testObject);
// on a desktop computer browser: {ResourceGroupId: "1", ResourceId: "11"}
// on a mobile device: {ResourceGroupId: "1", ResourceId: "11"}
groupIndex = this.eventBase.getGroupIndexFromEvent({
ResourceGroupId: args.data.ResourceGroupId,
ResourceId: args.data.ResourceId[0]
});
// on a desktop browser: (int) 1
// on a mobile browser: (int) 0
} else {
groupIndex = this.eventBase.getGroupIndexFromEvent(args.data);
}
}
if (groupIndex === 0) console.error("Unable to determine the groupIndex");
This is pretty weird - would you have any idea why this should yield different results based on whether the exact same software is run on e.g. Chrome/Firefox versus e.g. a Galaxy S5 or an Iphone?