Our powerful JS Calendar component


Post by vconstruct »

Hi,

Was trying to listen to Calendar date picker's events but getting the following errors -

onDateChange gives the following error which was mentioned https://bryntum.com/products/calendar/docs/api/Calendar/widget/CalendarDatePicker#event-dateChangein the document

dateChange.png
dateChange.png (9.67 KiB) Viewed 159 times

Also in console can see the onMonthDateChange which was not in the documents, tried using that as well but throwing this error -

monthDateChange.png
monthDateChange.png (14.99 KiB) Viewed 159 times

Post by tasnim »

Hi,

I tried to reproduce it

    datePicker : {
        listeners : {
            dateChange() {
                console.log('fires');
            }
        }
    }

It seems to be working fine.

Can you please upload a test case or show the code you're using to reproduce it?


Post by Animal »

onDateChange is not an event. It is the name of a function which a object which is in the process of firing a dateChange event will call.

So if the object is firing the doSomething event, it will first call a method on itself called onDoSomething if it exists.

And then it will trigger an event called doSomething which you may listen for by adding an event listener.

You can try this out in the online example if you modify the code like this:

Screenshot 2023-03-31 at 07.18.27.png
Screenshot 2023-03-31 at 07.18.27.png (220.21 KiB) Viewed 131 times

Post Reply