Flex 4 日期选择器 [英] Flex 4 DateChooser

查看:26
本文介绍了Flex 4 日期选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多天.我希望那些日子在 DateChooser 组件中有不同的背景颜色,比如红色.

I have an Array of days. I want those days to have a different background-color in the DateChooser component, say red.

请问我该怎么做?

推荐答案

DateChooser 不是那么容易定制!

The DateChooser isn't that easy to customise!

接近这个的东西会起作用,但你需要稍微调整它以适合你想要做的事情.

Something close to this will work, though you'll need to tweak it somewhat to suit what you want to do.

public class FancyDateChooser extends DateChooser {
    public var fancyStyleName : String;
    public var dayToMakeFancy : String;

    protected override createChildren() : void {
        super.createChildren();
        var dateGrid : UIComponent = mx_internal::dateGrid;
        for ( var i: int = 0; i < dateGrid.numChidren; i++ ) {
            if ( ( dateGrid.getChildAt( i ) as IUITextField ).text == dayToMakeFancy ) {
                dateGrid.getChildAt( i ).styleName = fancyStyleName;
            }
        }
    }
}

这篇关于Flex 4 日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆