打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
在可编辑datagrid中,使用my97日期控件

首先,扩展datagrid的editors,使其支持my97控件,当然在这之前别忘了引入my97的JS
01 $.extend($.fn.datagrid.defaults.editors, {
02     my97 : {
03         init : function(container, options) {
04             var input = $('<input class="Wdate" onclick="WdatePicker({dateFmt:\'yyyy-MM-dd HH:mm:ss\',readOnly:true});"  />').appendTo(container);
05             return input;
06         },
07         getValue : function(target) {
08             return $(target).val();
09         },
10         setValue : function(target, value) {
11             $(target).val(value);
12         },
13         resize : function(target, width) {
14             var input = $(target);
15             if ($.boxModel == true) {
16                 input.width(width - (input.outerWidth() - input.width()));
17             else {
18                 input.width(width);
19             }
20         }
21     }
22 });

然后,在datagrid的列中,加上editor,使当前列可以编辑
1 {
2                 field : 'modifydatetime',
3                 title : '最后修改时间',
4                 sortable : true,
5                 width : 130,
6                 editor : {
7                     type : 'my97'
8                 }
9             }
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
可编辑表格使用经验分享(持续更新) | WebUI框架使用参考
jQuery EasyUI自定义DataGrid的Editor
jQuery EasyUI
easyui学习笔记3
Intraweb之EasyUI篇
Jquery easyui开启行编辑模式增删改操作
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服