View previous topic :: View next topic |
Author |
Message |
njpmr
Joined: 28 Feb 2010 Posts: 24
|
Posted: Fri Apr 23, 2010 3:13 am Post subject: Calendar Close |
|
|
Why won't the calendar close when you click outside of it?
I have a calendar field in a form within an iframe that I dynamically hide/show
If I open the calendar and then click outside of it, it remains open.
I took the same exact scripts and defined a calendar input field in the main body and if I open the calendar and click anywhere on the page it closes the calendar (desired behavior)
Same behavior if gbautoclose is true or false
Thanks in advance for any assistance
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Fri Apr 23, 2010 12:07 pm Post subject: |
|
|
You need to put the calendar iframe outside your iframe. Please check the cross-frame demo in the download package for examples.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
njpmr
Joined: 28 Feb 2010 Posts: 24
|
Posted: Fri Apr 23, 2010 1:37 pm Post subject: |
|
|
The demo is exhibiting the same behaviour. That is the calendar defined within the iframe does not close when you click within the boundries of the iframe.
If you click out side the iframe, yes it closes.
I do not want to use autoclose on date selection but if the calendar is up and the user clicks either in another field in the iframe or just on the body of the iframe I would like the calendar to close. Is this possible?
Thanks
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Fri Apr 23, 2010 2:36 pm Post subject: |
|
|
Then you need to add some code to the document within the iframe to trigger the close.
E.g Code: | document.onclick=function(){gfPop.fHideCal()} |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
njpmr
Joined: 28 Feb 2010 Posts: 24
|
Posted: Fri Apr 23, 2010 3:24 pm Post subject: |
|
|
It is going to take more than that. I tried something similiar but if your are opening the calendar onclick, that code prevents the calendar from opening up.
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Fri Apr 23, 2010 5:57 pm Post subject: |
|
|
Then just check if the target is gfPop or not.
Code: | document.onclick=function(e){
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
if (targ.onclick && targ.onclick.toString().indexOf('gfPop')<0)
gfPop.fHideCal(); // only hide if the target is not the cal button
} |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
njpmr
Joined: 28 Feb 2010 Posts: 24
|
Posted: Fri Apr 23, 2010 10:26 pm Post subject: |
|
|
That solution did not work exactly as coded for me, but I was able to tweak it to get it to work. I was not familiar with using event.srcElement before.
Thanks for your assistance.
|
|
Back to top |
|
|
|