设置日期选择组件(DateField )的选择范围。

selectableRange 属性
示例:


代码:
<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2007/12/17/setting-selectable-ranges-in-the-flex-datefield-control/  -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="top"
        backgroundColor
="white" >

    
< mx:Form >
        
< mx:FormItem  label ="rangeStart only:" >
            
< mx:DateField  id ="dateField1"
                    showToday
="false"
                    selectableRange
=" {{rangeStart:new Date()}} "   />
        
</ mx:FormItem >
        
< mx:FormItem  label ="rangeEnd only:" >
            
< mx:DateField  id ="dateField2"
                    showToday
="false"
                    selectableRange
=" {{rangeEnd:new Date()}} "   />
        
</ mx:FormItem >
        
< mx:FormItem  label ="rangeStart/rangeEnd:" >
            
< mx:DateField  id ="dateField3"
                    showToday
="false"
                    selectableRange
=" {{rangeStart:new Date(2007, 11, 3),
                                      rangeEnd:new Date(2007,11,28)}}
"   />
        
</ mx:FormItem >
    
</ mx:Form >

</ mx:Application >

你可能感兴趣的:(Field)