CalendarView icon indicating copy to clipboard operation
CalendarView copied to clipboard

closeHandler Function example

Open tmcclint opened this issue 15 years ago • 1 comments
trafficstars

I'm trying to use the closeHandler parameter to run my function after the calendar pop-up closes. When I run it like this: Calendar.setup( { dateField: 'txtDeparture', triggerElement: 'departureBtn', closeHandler: 'updateFunc' } )

I get this error in Firebug: this.closeHandler is not a function http://www.mywebsite.com/js/calendarview.js Line 495

When I put a watch on that line, I see that "closeHandler" equals my function name but I think there might be a problem in the way I'm setting up that parameter. I can run my function through an onblur event and get the results I expect so I don't think it's my function causing the issue. Any clarification you can provide would be welcome.

Todd McClintic http://www.mcclinticdesign.com

tmcclint avatar Mar 11 '10 21:03 tmcclint

Had the same problem with selectHandler.

My workaround is to add onclick event after tbody is defined for the calendar table (link to source code line): tbody.setAttribute('onclick', 'yourfunction()') After that you can define your function and for example hide the embedded calendar with js/jquery change of display css attribute.

bartosjiri avatar Aug 20 '17 20:08 bartosjiri