Flex DateChooser events for individual days?

a 夏天 提交于 2019-12-13 02:55:09

问题


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?


回答1:


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.




回答2:


What about change?




回答3:


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



来源:https://stackoverflow.com/questions/710646/flex-datechooser-events-for-individual-days

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!