How to detect a click on a background event when two or more background events are on the same line in the month view mode?

It seems that I can not find the answer to this question - so I thought that I would do it.

I read a few answers on how to detect the click of a background event. For example: Discovery click on background event

However, I found that when two other background events are on the same line, only the last day displayed as a background event will contain the correct CSS target to allow detection. All the previous days on this line (the month view is what I work with) will act like regular dayClick events, even if they are actually displayed as background events.

For example, in this image, clicking on the 25th will be detected, but when you click on it the 22nd will not be:

Single line background events

Having looked at the source of the page, the first three days (from 22 to 24) appear on this image in a line with the inscription "1". This is a TD with a cap 3. The line with the inscription "2" is a line with TD containing the 25th:

enter image description here

Effectively anything before the 25th is cut off from targeting with fc-bgevent .

It should be noted that one background event that spans days works as expected. Therefore, if I just simply extended the end date of the event, which starts from the 22nd to the 25th, everything will work - except, of course, the β€œstart” date that you get in the click event will be the 22nd, regardless from what day when you click.

Has anyone found a way around this?

What I want to do is visualize the background events, and also determine the date when they are clicked.

Thank you in advance.

+3
source share
1 answer

Use selectOverlap to detect click on background events

 selectOverlap: function(event) { // Here you will get all background events which are on same time. console.log(event); return event.rendering === 'background'; } 
+3
source

Source: https://habr.com/ru/post/1208583/


All Articles