datepickerx设置默认日期

datepicher插件是jQuery UI的一个插件,它提供一个日期弹出窗口(或直接显示在页面),供用户选择日期。在Web开发中,总会遇到需要用户输入日期的情况。一般都是提供一个text类型的input供用户输入日期,我们在实际开发中会遇到给日期控件设置默认日期的情况,下面我们就举例解释jquery easyui datepickerx控件是如何实现设置默认日期的:

<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="/coframe/tools/skins/common.jsp" %>
<%@taglib uri="http://org.gocom.components.authTag/tag" prefix="auth" %>
<%@include file="/common.jsp" %>
<html>
<!--
  - Author(s): caowenliang
  - Date: 2016-07-15 12:08:01
  - Description:
-->
<head>
<title>回款里程碑审核</title>
<style type="text/css">
.New_Button, .Edit_Button, .Delete_Button, .Update_Button, .Cancel_Button
{
    font-size:11px;color:#1B3F91;font-family:Verdana;
    margin-right:5px;
}
.monthrow
{
    background:#fceee2;
}
</style>
<body>
 <div>
    <div id="form1" style="padding-top:0px;">
        <fieldset style="width:97%;height:100%;border:solid 1px #aaa;margin-top:0px;position:relative;">
        <legend>申请信息</legend>
            <div><label>完工日期:</label>
                <td><input id="rfinish_date" class="nui-datepickerx" enabled="false"/></td>
                <td><input id="attachmentId" class="nui-hidden"/></td>
                </div>
                <fieldset style="float:left;width:40%;height:150px;border:solid 1px #aaa;margin-top:0px;position:relative;">
                    <legend>附件信息</legend>
                    <div class="nui-toolbar;" style="border-bottom:0;padding:0px;">
                        <table >
                            <tr><!-- 文件上传 -->
                               <td style="width:40%">下载附件:</td>
                                   <td style="white-space:nowrap;" ><div id=‘download‘></div></td>
                                <td >
                                    <input id="fileid" name="dpGdAdj.fileid" class="nui-hidden" />
                                   </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
                <fieldset style="float:right;border:solid 1px #aaa;margin-top:0px;position:relative;width:54%;height:150px;">
                <legend>交付物计划</legend>
                    <div class="nui-fit">
                    <div id="datagrid1" class="nui-datagrid" style="width:100%;height:100%;" dataField="data"
                        url="com.shtech.dp2.prjplan.ProjectManager.queryPod.biz.ext" multiSelect="true"
                        allowCellEdit="true" allowCellSelect="true" editNextOnEnterKey="true"
                        idField="podid" showPager="false"  showFooter="false" allowSortColumn="false">
                        <div property="columns">
                            <div type="checkcolumn"></div>
                            <div field="podid" visible="false"><!-- 交付物ID --></div>
                            <div field="podname" width="100" headerAlign="center" allowSort="true" vtype="required">交付物名称
                                <input property="editor" class="nui-textbox" style="width:100%;" maxLength="25"/>
                            </div>
                            <div field="comcriteria" width="60" renderer="renderComcriteria" allowSort="true" align="center" headerAlign="center">完成标准
                                <input property="editor" class="nui-dictcombobox" dictTypeId="DP2_COMCRITERIA" />
                            </div>
                            <div field="carrformat" width="70" renderer="renderCarrformat" allowSort="true" align="center" headerAlign="center">载体形式
                                <input property="editor" class="nui-dictcombobox" dictTypeId="DP2_CARRFORMAT" />
                            </div>
                            <div field="demandtype" width="60" renderer="renderDemandtype" allowSort="true" align="center" headerAlign="center">要求来源
                                <input property="editor" class="nui-dictcombobox" dictTypeId="DP2_DEMANDTYPE" />
                            </div>
                            <div field="baseline" width="70" renderer="renderBaseline" allowSort="true" align="center" headerAlign="center">基线名称
                                <input property="editor" class="nui-dictcombobox" dictTypeId="DP2_BASELINE" />
                            </div>
                            <div type="comboboxcolumn" field="gcMscellid" width="100" headerAlign="center" vtype="required" >所属里程碑
                                <input property="editor" class="nui-combobox" style="width:100%;"
                                data="listData" />
                            </div>
                        </div>
                    </div>
                 </div>
                </fieldset>
                <table>
                    <label>差异说明:</label>
                    <td><textarea id="note" class="nui-textarea" style="width:860px;" emptyText="请输入差异说明" ></textarea></td>
                    </tr>
              </table>
        </fieldset>
         <fieldset style="width:97%;height:100%;border:solid 1px #aaa;margin-top:4px;position:relative;">
             <label>确认日期:</label>
                <td><input id="cfmddate" class="nui-datepickerx" required="true"/></td></br>
             <table>
                    <label>审批意见:</label>
                    <td><textarea id="note" class="nui-textarea" style="width:860px;" emptyText="请输入审批意见" ></textarea></td>
                    </tr>
                    <tr>
                        <td style="text-align:center;">
                           <a class="nui-button" iconCls="icon-save" onclick="onok">通过</a>
                           <span style="display:inline-block;width:1;"></span>
                           <a class="nui-button" iconCls="icon-save" onclick="no">驳回</a>
                           <span style="display:inline-block;width:25px;"></span>
                           <a class="nui-button" iconCls="icon-cancel" onclick="onCancel">取消</a>
                        </td>
                     </tr>
              </table>
          </fieldset>
         <div>
            </div>
    </div>
    </div>
</div>
</body>
<script type="text/javascript">
   nui.get("rfinish_date").setValue(new Date());
   nui.get("cfmddate").setValue(new Date());
</script>
</html>

看页面展示效果:

时间: 2024-08-01 14:16:07

datepickerx设置默认日期的相关文章

ExtJs迄今datefield控制设置默认值

假设extjs4 datefield日期控件设置默认值.为当天的前一月,和后一月 Ext.Date.MONTH      月 Ext.Date.YEAR         年 Ext.Date.DAY           天 '日期', { xtype:'datefield', itemId:'beginDate', format:'Y-m-d', value:Ext.util.Format.date(Ext.Date.add(new Date(),Ext.Date.MONTH,-1),"Y-m-

Linux date命令-显示和设置系统日期与时间 压缩包以YYMMDD格式命令

date --help用法:date [选项]... [+格式] 或:date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]以给定的格式显示当前时间,或是设置系统日期. -d,--date=字符串        显示指定字符串所描述的时间,而非当前时间  -f,--file=日期文件        类似--date,从日期文件中按行读入时间描述  -r, --reference=文件        显示文件指定文件的最后修改时间  -R, --rf

MySql折腾小记二:text/blog类型不允许设置默认值,不允许存在两个CURRENT_TIMESTAMP

From: http://www.cnblogs.com/cyq1162/archive/2011/05/17/2049055.html 在 CYQ.Data 数据框架的反向工程中,遇到MySQL的问题又2个,记录下先. 1:对于时间的默认值,为:CURRENT_TIMESTAMP,不允许一个表存在两个日期都设置了:CURRENT_TIMESTAMP 解决的办法: 按理只设一个. 但在反向工程中,若遇到两个或以上的设置,为保证导数据的正常,直接取消日期的默认值. 2:text/blog类型不允许

CentOS下date命令 - 显示和设置系统日期与时间

显示系统日期 要显示系统日期,只要输入: $ date Thu Dec 5 22:55:41 WIB 2013 格式化显示日期 日期有很多格式.如果你不喜欢默认的格式,你可以换一种格式.你可能会想"为什么我需要改变格式? 默认的输出对我足够了." 是的,你说的对,但是当你在编程时,默认输出或许无法满足你的需求,因此需要一些自定义输出. RFC 2822 的日期与时间输出格式 $ date -R Thu, 05 Dec 2013 23:40:53 +0700 RFC 2822 的格式像这

spring @Value 设置默认值

@Value 的作用不用说 大家都知道 注解模式下 读取配置文件 注入属性值 /** * MQ地址 */ @Value("${NamesrvAddr}") private String namesrvAddr;   上面的是一个标着的 @Value 注解 如果配置文件中没有设置 NamesrvAddr Spring 在启动的时候讲报错. 设置默认值很简单 @Value("${NamesrvAddr:192.168.0.1}") private String name

EF Core1.0 CodeFirst为Modell设置默认值!

当我们使用CodeFirst时,有时候需要设置默认值! 如下 public int Delete { get; set; } = 0; public string AdminName {get; set;} = "admin"; public bool CacheDbResults { get; set; } = true;

HTML中的&lt;select&gt;标签如何设置默认选中的选项

方法有两种. 第一种通过<select>的属性来设置选中项,此方法可以在动态语言如php在后台根据需要控制输出结果. 1 2 3 4 5 < select  id =  "sel" > < option  value = "1" >1</ option > < option  value = "2"  selected = "selected" >2</ opt

Oracle 12c创建PDB用户并设置默认表空间

Oracle12c 中,增加了可插接数据库的概念,即PDB,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB).CDB全称为 ContainerDatabase,中文翻译为数据库容器,PDB全称为PluggableDatabase,即可插拔数据库.下面是官方文档关于CDB与PDB的关系图. 在CDB中,只能创建以c##或C##开头的用户,如果不加c##,则会提示错误“ORA-65096:公用用户名或角色名无效”,只有在PDB数据库中才能创建我们习惯性命名的用户,oracle称之为Loca

Siebel 找字段、下拉菜单设置值、弹出新页面、弹出选择框、设置默认值 、按钮代码

产品缺陷太多,跟用户交互不人性化.例如搜索新建客户功能,用户输入后会自动保存数据,一旦保存后一. 找字段1.简单 CTRL+Q CTRL+Q 服务请求编号----对应的表.字段.长度: 客户编码-----对应的表.字段.长度(弹出新页面):- 点击上面的pick Applet会弹出“选取客户”对话框 有JOIN就不用TABLE:require代表必填 字段有两个值----项目编号 下图确定只有projectNum有用 3.表单中的字段(不在list column中,而是在control) 二.下