views:

1021

answers:

3

I'm using a DateChooser, and want to show different information in a tooltip as the user rolls over each day. Is there an event that fires as I'm rolling around the calendar that will tell me what day I'm currently over?

A: 

What about change?

dirkgently
isn't that only fired on click?
sprugman
(or perhaps when the selected date is changed programmatically) -- I'm not talking about the selected date, only the hovered date.
sprugman
You will need to have a MouseEvent handler as suggested in the other post.
dirkgently
+4  A: 

It's a little complicated. You're going to need to use the mx_internal namespace. The grid portion of the DateChooser component is a CalenderLayout component in DateChooser.as.

mx_internal var dataGrid:CalenderLayout;

CalenderLayout.as has the mouseMoveHandler. In the handler we have:

var selCell:IUITextField = dayBlocksArray[colIndex][rowIndex];

that gives you the necessary info about which day the mouse is over. You will need to extend DateChooser to use an extended CalendarLayout that exposes the selectedCell.

perhaps:

private function mouseMoveHandler(event:MouseEvent):void
{
    ...
    dispatchEvent(new DayHoverEvent(selCell.text));
}

I guess what I'm trying to say is it's kinda tricky, and it uses mx_internal, which means the variables are subject to change in later versions of Flex.

CookieOfFortune
Sweet exactly what i was searching for. I added a dispatchEvent to mousup instead of MouseMoveHandler as MouseMoveHandler was triggering streaming events of selCell.text.
Satish
A: 

Hi,

You may want to check out my blog post on this: http://flexmonkey.blogspot.com/2010/06/displaying-color-coded-events-in-flex.html

I've based this on some previous work by Kevin Brammer (http://www.cyberslingers.com/weblog/post/Adding-Calendar-Event-Entries-to-the-Flex-DateChooser-Component.aspx) - it allows you to add a tooltip to individual days and colour code them

Hope it helps,

simon

Simon Gladman