简体   繁体   English

Flex DateChooser活动是否有个别日子?

[英]Flex DateChooser events for individual days?

I'm using a DateChooser, and want to show different information in a tooltip as the user rolls over each day. 我正在使用DateChooser,并希望在用户每天滚动时在工具提示中显示不同的信息。 Is there an event that fires as I'm rolling around the calendar that will tell me what day I'm currently over? 我在日历上滚动时是否会触发某个事件,该事件会告诉我当前结束的日期?

It's a little complicated. 这有点复杂。 You're going to need to use the mx_internal namespace. 您将需要使用mx_internal命名空间。 The grid portion of the DateChooser component is a CalenderLayout component in DateChooser.as. DateChooser组件的网格部分是DateChooser.as中的CalenderLayout组件。

mx_internal var dataGrid:CalenderLayout;

CalenderLayout.as has the mouseMoveHandler. CalenderLayout.as具有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. 您将需要扩展DateChooser以使用扩展的CalendarLayout来公开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. 我想我想说的是有点棘手,它使用了mx_internal,这意味着变量在Flex的更高版本中可能会发生变化。

You may want to check out my blog post on this: http://flexmonkey.blogspot.com/2010/06/displaying-color-coded-events-in-flex.html 您可能想查看我关于此的博客文章: 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 我已经基于Kevin Brammer( http://www.cyberslingers.com/weblog/post/Adding-Calendar-Event-Entries-to-the-Flex-DateChooser-Component.aspx )的一些以前的工作-它允许您可以向各个日期添加工具提示并为它们加上颜色代码

Hope it helps, 希望能帮助到你,

simon 西蒙

change呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM