Page 1 of 1

[REACT] event click is not working in week view

Posted: Tue May 30, 2023 1:24 pm
by vconstruct

Hi I am using eventclick listener it is working perfectly fine in month view but this is not getting triggered in week view

if(this.calendarRef.instance.onEventClick) {console.log('click')}

This is not triggered during week view but works fine in month


Re: [REACT] event click is not working in week view

Posted: Tue May 30, 2023 1:34 pm
by tasnim

Hi,

Try using like this

    listeners : {
        eventClick() {
            console.log('click');
        }
    }

https://bryntum.com/products/calendar/docs/api/Calendar/view/Calendar#event-eventClick


Re: [REACT] event click is not working in week view

Posted: Tue May 30, 2023 3:40 pm
by vconstruct

Sure it works if we have done it as you have mentioned.

But the thing is we are looking for a different approach where we want to call it through calendar instance

 if(this.events?.onActivitySelected){
     this.calendarRef.instance.onEventClick = this.events.onActivitySelected;
 }

This is the code that is working fine for month view but it is not working for week view


Re: [REACT] event click is not working in week view

Posted: Tue May 30, 2023 4:59 pm
by alex.l

Hi,

But the thing is we are looking for a different approach where we want to call it through calendar instance

Please post more context, not clear what this code do and how it invoked. Best of all if you attach a full app that we can debug. It help us to answer faster.

Thanks.


Re: [REACT] event click is not working in week view

Posted: Wed May 31, 2023 11:23 am
by vconstruct

We have configured the instance through ref and want to access onEvent listener through this instance

calendar ref.png
calendar ref.png (51.29 KiB) Viewed 270 times

Re: [REACT] event click is not working in week view

Posted: Wed May 31, 2023 12:15 pm
by tasnim

Could you please attach a full test app? so we can run it and debug it?
A test app will make the assistance faster.