dateTime选择控件 [英] dateTime choice Control

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

问题描述

您好 

我正在搜索如何控制日期时间字段 

i有两个列表(项目和活动) 

项目列表有一个dateTime字段

i想知道如何控制在项目列表日期之前无法选择的活动列表的日期 

i已将字段作为项目标题的查找 

exp 2015年9月15日的项目午餐,并且应在该日期之后选择activityDate 

谢谢求助(我使用visual studio)

Hello 
i'm searching how can i control the DateTime Field 
i have two Lists (Project and activity) 
the project list had a dateTime Field
i want to ask how can i control the date for activity list that it cant be select before the date of project list 
i has make a field as a lookup for project title 
exp the project lunch on 15/09/2015 and the activityDate should be select after that date 
thank you for help (i work with visual studio)

推荐答案

我们可以创建一个事件接收器控制活动列表中的DateTime。

We can create an event receiver to control the DateTime filed in activity list.

在接收器中,获取项目列表日期时间字段,如果项目列表中的日期时间之前的activityDate,则返回错误消息和取消该事件。

In the receiver, get the Project list date time field, if the activityDate before the date time in project list, return the error message and cancel the event.

properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = "custom error message";
properties.Cancel = true;


 

或者我们可以使用JavaScript客户端对象模型和jQuery代码来限制日期时间字段值。

 

Or we can use JavaScript client object model and jQuery code to restrict the date time filed value.

最好的问候,

Dennis


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

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