Hi,
i've seen in the original js component (https://www.primefaces.org/primeng/#/calendar) the event 'onMonthChange'.
How can I use the event onMonthChange in the new jsf primefaces datepicker?
Thanks
Best regards
Datepicker: onMonthChange event
I think you will have to request it on Github. I don't see any "on" method for client side JS callbacks.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
I was thinking in use the javascript options of the componet.
For instance, in calendar I can use this code in order to register a new function for an event which hasn't callback
PF('widgetNameCalendar').jqEl.datetimepicker('option', 'onClose', function(){console.log('closed')})
I tried
PF('widgetNameDatePicker').jqEl.datePicker('option', 'onMonthChange', function(){console.log('month changed')})
but I get this javascript error
Uncaught Error: cannot call methods on datePicker prior to initialization; attempted to call method 'option'
Best regards
For instance, in calendar I can use this code in order to register a new function for an event which hasn't callback
PF('widgetNameCalendar').jqEl.datetimepicker('option', 'onClose', function(){console.log('closed')})
I tried
PF('widgetNameDatePicker').jqEl.datePicker('option', 'onMonthChange', function(){console.log('month changed')})
but I get this javascript error
Uncaught Error: cannot call methods on datePicker prior to initialization; attempted to call method 'option'
Best regards
Yep the DatePicker is a completely new JS component written from the ground up. The Calendar component is based on JQuery UI DatePicker widget. I think you will have to request this enhancement here: https://github.com/primefaces/primefaces/issues
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 1
- Joined: 20 May 2020, 19:39
onMonthChange event and onYearChange event is also triggering the normal html (change) event.
but the date value also not changed..
Better to do an event.prevent default before emitting this event
but the date value also not changed..
Better to do an event.prevent default before emitting this event
-
- Information
-
Who is online
Users browsing this forum: No registered users and 26 guests