$.extend($.fn.datagrid.defaults.editors, {
datetimebox: {// datetimebox就是你要自定义editor的名称
init: function (container, options) {
var input = $('<input class="easyuidatetimebox">').appendTo(container);
return input.datetimebox({
formatter: function (date) {
return new Date(date).format("yyyy-MM-dd hh:mm:ss");
}
});
},
getValue: function (target) {
return $(target).parent().find('input.combo-value').val();
},
setValue: function (target, value) {
$(target).datetimebox("setValue", value);
},
resize: function (target, width) {
var input = $(target);
if ($.boxModel == true) {
input.width(width - (input.outerWidth() - input.width()));
} else {
input.width(width);
}
}
}
});
// 时间格式化
Date.prototype.format = function (format) {
/*
* eg:format="yyyy-MM-dd hh:mm:ss";
*/
if (!format) {
format = "yyyy-MM-dd hh:mm:ss";
} var o = {
"M+": this.getMonth() + 1, // month
"d+": this.getDate(), // day
"h+": this.getHours(), // hour
"m+": this.getMinutes(), // minute
"s+": this.getSeconds(), // second
"q+": Math.floor((this.getMonth() + 3) / 3), // quarter
"S": this.getMilliseconds()
// millisecond
}; if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
} for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};

datetimebox的更多相关文章

  1. 时间控件之赋值问题:datetimebox

    1.datetimebox不显示毫秒数: <input class="easyui-datetimebox" name="birthday" data-o ...

  2. easyUI中datetimebox和combobox的取值方法

    easyUi页面布局中,查询条件放在JS中,如下 <script type="text/javascript"> var columnList = [ [   {    ...

  3. EasyUI修改DateBox和DateTimeBox的默认日期格式

      最近整理Easyui控件的时候,对Easyui的DateBox控件和DateTimeBox控件进行了梳理,而我之所以将EasyUI的DateBox控件和DateTimeBox控件放在一起,归为一类 ...

  4. EasyUI改动DateBox和DateTimeBox的默认日期格式

    近期整理Easyui控件的时候,对Easyui的DateBox控件和DateTimeBox控件进行了梳理,而我之所以将EasyUI的DateBox控件和DateTimeBox控件放在一起,归为一类,是 ...

  5. easyui DateTimeBox 取值

    $('#dt').datetimebox('getValue')

  6. DateTimeBox( 日期时间输入框)

    本节课重点了解 EasyUI 中 DateTimeBox(日期时间输入框)组件的使用方法,这个组件依赖于 DateBox(日期输入框)组件和 TimeSpinner(时间微调)组件. 一. 加载方式/ ...

  7. easyui DateTimeBox OK

    一.datetimebox   ok按钮没有点击事件,但是可以通过onSelect事件模拟出“点击了ok按钮一样的效果”,我的代码: 关键: 0,理解DateTimeBox控件,这个控件是由DateB ...

  8. 自定义EasyUI的datetimebox控件日期时间的显示格式(转)

    工作中遇到的问题,在此记录一下. 需求:前台页面使用了EasyUI框架,在某一个html页面中要求datetimebox显示格式为年月日和小时,如图所示: 尝试过两种方法,分别如下: 第一种方法: d ...

  9. Easyui的datagrid的editor(行编辑器)如何扩展datetimebox类型

    在easyui的datagrid扩展方法中添加这样的时间日期(datetimebox)代码块 放在   $.extend($.fn.datagrid.defaults.editors,{datetim ...

  10. datagrid行内编辑时为datetimebox

    $.extend($.fn.datagrid.defaults.editors, { datetimebox: {// datetimebox就是你要自定义editor的名称 init: functi ...

随机推荐

  1. phoenix部署手册-基于hbase

    背景描述: phoenix基于hbase的SQL层,映射hbase的表,也可以映射视图(VIEW) 部署安装比较简单 映射表和视图的区别: 映射表: 在Phoenix建表错误不易更改: 删除会连同hb ...

  2. CentOS限制SSH登录地址

    编辑hosts.allow文件,将允许连接的地址写进去 [root@Elements ~]# vim /etc/hosts.allow sshd:10.10.10.1:allow sshd:172.1 ...

  3. 初入Spring-boot(三)

    Spring boot 的运行原理 Spring boot关于自动配置的源码在spring-boot-autoconfigure-xxxx.jar内. 一.可以通过下面三种方式查看当前项目中已启用和未 ...

  4. Hibernate的一级缓存、二级缓存和查询缓存。

    Hibernate的Session提供了一级缓存的功能,默认总是有效的,当应用程序保存持久化实体.修改持久化实体时,Session并不会立即把这种改变提交到数据库,而是缓存在当前的Session中,除 ...

  5. flume-ng源码阅读memory-channel(原创)

    org.apache.flume.channel.MemoryChannel类是Flume-NG的memory-channel. private LinkedBlockingDeque<Even ...

  6. cn_03_r2_enterprise_sp2_x86_vl_X13_46432

    1. 使用的 ISO为:cn_win_srv_2003_r2_enterprise_with_sp2_vl_cd1_X13-46432.iso 2.序列号 用的序列号是“DF74D-TWR86-D3F ...

  7. 第三方库PIL简单使用

    PIL为第三方库,需要简单安装,最容易的安装方法 pip install PIL 详细内容见http://effbot.org/imagingbook/ 下面展示一个简单用例:(字母验证码简单实现) ...

  8. 临时开启Chrome 67拖放crx安装扩展方法

    打开Chrome的设置: chrome://flags/#extensions-on-chrome-urls 更改为enabled,应用后重起浏览器,就可以往 chrome://extensions ...

  9. 七 web爬虫讲解2—urllib库爬虫—状态吗—异常处理—浏览器伪装技术、设置用户代理

    如果爬虫没有异常处理,那么爬行中一旦出现错误,程序将崩溃停止工作,有异常处理即使出现错误也能继续执行下去 1.常见状态吗 301:重定向到新的URL,永久性302:重定向到临时URL,非永久性304: ...

  10. Lucene快速入门

    1. 什么是lucene lucene是Apache的一个全文检索工具,使用lucene能快速实现全文检索功能.Lucene是一个工具包,你可以调用它的函数, 但它不能独立运行,不单独对外提供服务. ...