CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calendar Close

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related
View previous topic :: View next topic  
Author Message
njpmr



Joined: 28 Feb 2010
Posts: 24

PostPosted: Fri Apr 23, 2010 3:13 am    Post subject: Calendar Close Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Fri Apr 23, 2010 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
njpmr



Joined: 28 Feb 2010
Posts: 24

PostPosted: Fri Apr 23, 2010 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Fri Apr 23, 2010 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
njpmr



Joined: 28 Feb 2010
Posts: 24

PostPosted: Fri Apr 23, 2010 3:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Fri Apr 23, 2010 5:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
njpmr



Joined: 28 Feb 2010
Posts: 24

PostPosted: Fri Apr 23, 2010 10:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group