Page 1 of 1
[REACT] Calendar date picker events throwing error
Posted: Thu Mar 30, 2023 3:28 pm
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 (9.67 KiB) Viewed 218 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 (14.99 KiB) Viewed 218 times
Re: [REACT] Calendar date picker events throwing error
Posted: Thu Mar 30, 2023 3:52 pm
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?
Re: [REACT] Calendar date picker events throwing error
Posted: Fri Mar 31, 2023 7:21 am
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 (220.21 KiB) Viewed 190 times