538
Views
2
Comments
[FullCalendar 2] Dayclick event
Question
fullcalendar-2
Web icon
Forge asset by João Grazina
Hi,

I'm trying to change this component to add the feature to catch the dayClick event. I'm adding something like the code that I have below in the jQuery of the component. It works fine and notify me with the expected behaviour but in chrome I have the following error:
Uncaught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('hidden') does not support selection. 

What I'm doing wrong?

Thanks.

Best Reggards,
Nuno Mendes

// Clicking & Hovering dayClick
            dayClick: function(date, calEvent, jsEvent, view) {
                var calEventJS = {
                    action:""dayclick"",
                    range:{
                        start:date.format(),
                        end:date.format()
                    },
                    delta:undefined,
                    event:calEvent
                };
                $('#"+e_cal.Id+"').val(safeJsonStringify(calEventJS));
                $('#"+link_notify.Id+"').click();

                "+Callback_DayClick+"
            }

2023-05-02 16-46-00
João Grazina
Hi Nuno,

You have more parameters than dayClick can hold!
Check out the structure of the dayClick callback: https://fullcalendar.io/docs/mouse/dayClick/
It is waiting for date, jsEvent, view.

Anyway I've added this new callback to the component, now you can use it directly like the other events. The structure fills out a range with start and end equaling the day that was clicked.
Check the Sample application for examples.

Kind Regards,
João Grazina 

UserImage.jpg
Nuno Mendes
Hi Grazina,

Yes after my post I have figure it out what I was doing wrong. I have already It working. I will check your sample to see how you fill the range.

Thanks.

Best Reggards,
Nuno Mendes
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.