I dont want overlapping for all the events i create, is there any way where i can specify my condition and if condition is true then only overlapping occurs else not.
There is also a helper method that will check an overlap of two date ranges - DayPilot.Util.overlaps():
function eventMoving(args) {
var customCondition = args.row.id === "A"; // checking overlaps for row with id === "A" only
if (!customCondition) {
return;
}
var overlaps = args.row.events.all().some(function(e) {
if (e.id() === args.e.id()) { // the target can overlap with the source event
return false;
}
return DayPilot.Util.overlaps(args.e.start(), args.e.end(), e.start(), e.end());
};
if (overlaps) {
args.allowed = false;
}
}
Comment posted by nidhi 8 years ago.
Thanks for the reply.
Actually In my case , i need TimeRangeSelectingJavascript="Selecting(args)";
And my problem is ,few parameters are available like -args.start, args.end but i need the args.text
basically for my condition.
Actually i have 2 types of events - one is appointment(created on timerangeselection)and other is blocked events.(on right click)
and I want overlapping should be allowed for appointment events and not for blocked events.
Once blocked events are created , i should not be able to give appointment event.
I hope you understand my need.
Please tell me how can i do this?
Comment posted by nidhi 8 years ago.
Hey please help. I am stuck.
I am using
TimeRangeSelectingJavascript="Selecting(args)";
when i am selecting / clicking a range then
1. I should get all the overlapping events for that range (how , pls tell me )
2. Iterating each event - if every overlapping event text contains some fixed Text(customised condition) then i should allow overlapping .
and if even the one of the overlapping events does not satisfy the condition then i should not allow overlapping.
Pls help me how can i do that?
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.