在 Flex 中设置 DateField 的允许范围?
我有一个 Flex 屏幕 (MXML),其中包含两个日期字段(例如,“起始日期”和“截止日期”)。根据日期值,数据必须显示在 DataGrid 上。在这里,我必须限制用户选择日期值。必须在日期字段中设置允许的范围。
例如,两个日期字段的默认日期都是“今天” 起始日期的允许范围是“今天 - 7 日到今天” 迄今为止的允许范围也是“今天 - 7 日到今天”
我怎样才能实现这一目标?通过选择日期选择器以及输入日期值(如果日期字段设置为可编辑)
I have a Flex screen (MXML) with two date fields (say, From and To date). Based on the date values, data has to be shown on the DataGrid. Here, I have to restrict the user on choosing the date value. A permitted range has to be set in the date field.
Eg, The default date for both date fields is "Today"
The permitted range for From Date is "Today - 7 to Today"
The permitted range for To Date is also "Today - 7 to Today"
How can I achieve this? Both by selecting the date picker as well as by entering the date value if the date field is set to editable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只需为这种逻辑实现一个自定义
DateValidator
,特别是用户还可以以无效或不支持的格式输入某些日期。ActionScript(伪代码):
MXML(伪代码):
让我知道这是否适用于您的情况
I would simply implement a custom
DateValidator
for this kind of logic especially that users can also type-in certain dates in invalid or not supported format.ActionScript (pseudo-code):
MXML (pseudo-code):
Let me know if this is working in your case