Calendar examples updated
I have updated my calendar examples to include the changes for YUI Version .12. The following examples have been updated:
- YUI: Calendar Row Selection
- YUI: Calendar Attached to Text Input
- YUI: Calendar with tooltip selected days
UPDATE: I added 2 more calendar examples that aren’t in this list:








December 1st, 2006 at 10:42 am
Dave,
Safari (WebKit) has issues with two of the examples. Found with latest OS and Safari 2.0.4 (419.3).
Calendar Attached to Text Input - the calendar opens behind the source listing, just a few pixels at the top is visible.
Calendar with tooltip selected days - the tooltips are only a few pixels in height.
Neither of these problems is found with Firefox 2.0 on OS X.
December 1st, 2006 at 12:39 pm
Rich –
I have fixed the issue with the “Calendar Attached to Text Input”, but I can not duplicate the issue with the tool tips…
December 1st, 2006 at 12:57 pm
Interesting…
The tooltips work in Safari, but not in NetNewsWire (which uses WebKit).
December 1st, 2006 at 1:13 pm
ah –
I have noticed that the Javascript Interpreter that NetNewsWire uses does not work very well..
December 4th, 2006 at 11:49 am
Hi Dave,
I think there is a small bug with the Calendar Text Input example: http://blog.davglass.com/files/yui/cal2
If you click the forward arrow to go to Januray 2007, choose a date, then click back on the text field to select a new date, it won’t let you.
It doesn’t seem to work on the latest FF and IE 7 on windows xp. But, it looks like Opera 9 works fine. Weird.
Just thought you should know about that.
Thanks for the GREAT examples!
December 4th, 2006 at 12:26 pm
Ryan –
Thanks for that catch.. The example has been updated.
It was a real weird one.. It seems that the Calendars render function makes a call to :
YAHOO.util.Event.purgeElement(this.oDomContainer, true);That was killing my listeners for mouseover and mouseout.. I have moved them into a
renderEventCustomEvent so they will be recreated when the calendar gets re-rendered..January 3rd, 2007 at 8:52 am
Dave:
I like the Calendar popup from text field. When I tried your updated version, I got $E, $D and $T undefined errors. When I
tried your original example, it works fine. What are those $E, E and T? Where are they defined?
I also like the tooltip sample? How can I integrate that example to the calendar popup from text field example? I have all
tip msg stored in database. I’d like to see mouse over event calls DWR methods to retrieve the tip msg from database. If
the msg avaialbe for that date, it would show it as a tip. Otherwise, display nothing. Is it possbile to do? Please advise.
Thanks.
January 3rd, 2007 at 8:57 am
qin –
The $, $E, $D, $T vars are all part of my YUI Tools package, you can find it here:
http://blog.davglass.com/files/yui/tools/
As for the tooltips, I would be rather simple to do. I wouldn’t recommend doing an HXR on a mouse over.. I would suggest that it be done before the loading of the calendar.. Doing it on mouseover would likely give you a DOS attack on your entry point.. It would really eat up bandwidth and extra requests to the server.
Cheers..
Dav
January 17th, 2007 at 9:42 pm
hi,
i’m using popup calender in my application, it is displaying calender on the specified location.. its good.
but i have to retrive the date fields from the popup calender only . let me know the way ..plz
itsis very urgent
bhargav
April 21st, 2007 at 8:20 pm
Is it possible to attache the calendar to multiple text fields within the one form. I am havinf some problems. I ran up a quick hack, that takes a var in init, then looks for “calContatiner”+dateElement; I am not getting any errors but calendars do not display. I can mail you my crude hack. Any suggestions on how I would do this?
Thanks in advance.
April 21st, 2007 at 10:04 pm
@AJ –
Here is an example of doing that:
http://blog.davglass.com/files/yui/cal2/more.php
April 22nd, 2007 at 4:15 am
Ahh, the answer is always the easier option. Thank you, I went at it the long long way
This works perfect.
June 11th, 2007 at 7:48 am
Do you think we need such a big piece of code to achieve the tooltip..Here is another thought..
var arr = { ‘6/30/2007′:’This is the 7th of June’,
‘6/23/2007′:’This is one more day’};
var tooltip = function(e){
var ab = cal1.getDateFieldsByCellId(e.target.id);
var b = ab[1]+”/”+ab[2]+”/”+ab[0];
if (arr[b])
new YAHOO.widget.Tooltip(’tt’,{context:e.target.id,
text:arr[b]});
}
YAHOO.util.Event.addListener(’cal1′, “mouseover”, tooltip);
THnks
Blue
June 11th, 2007 at 9:09 am
I was checking with IE .it does n\\\’t work .Here is a tweak..
var arr = { ‘6/30/2007′:’This is the 7th of June’,
‘6/23/2007′:’This is one more day’};
var tooltip = function(e){
var id =\\\”\\\”;
if(e.target)
id = e.target.id;
else
id = e.srcElement.id;
endif;
var ab = cal1.getDateFieldsByCellId(e.target.id);
var b = ab[1]+”/”+ab[2]+”/”+ab[0];
if (arr[b])
new YAHOO.widget.Tooltip(’tt’,{context:e.target.id,
text:arr[b]});
}
YAHOO.util.Event.addListener(’cal1′, “mouseover”, tooltip);
August 7th, 2007 at 10:30 am
Hi, i’m using your example of YUI: Calendar Row Selection with no results.I’d like to know if it’s possible to select a range of dates like here:http://www.hoteldoncarlos.com/reservas.phpThanks in advance,Chonli
August 7th, 2007 at 9:48 pm
Chonli –
Currently the Calender doesn’t support range selection, but a bug has been filed for it:
http://sourceforge.net/tracker/index.php?func=detail&aid=1670139&group_id=165715&atid=836479
It wouldn’t be that hard to get this to work, I may try to take a stab at it if I get some extra time..