zoukankan      html  css  js  c++  java
  • 在可编辑datagrid中,使用my97日期控件

    地址:http://easyui.btboys.com/post-55.html用处很大

    效果:

    方法:

    首先,扩展datagrid的editors,使其支持my97控件,当然在这之前别忘了引入my97的JS

    $.extend($.fn.datagrid.defaults.editors, {
        my97 : {
            init : function(container, options) {
                var input = $('<input class="Wdate" onclick="WdatePicker({dateFmt:\'yyyy-MM\',readOnly:true});"  />').appendTo(container);
                return input;
            },
            getValue : function(target) {
                return $(target).val();
            },
            setValue : function(target, value) {
                $(target).val(value);
            },
            resize : function(target, width) {
                var input = $(target);
                if ($.boxModel == true) {
                    input.width(width - (input.outerWidth() - input.width()));
                } else {
                    input.width(width);
                }
            }
        }
    });

    然后,在datagrid的列中,加上editor,使当前列可以编辑

    {
                    field : 'modifydatetime',
                    title : '最后修改时间',
                    sortable : true,
                    width : 130,
                    editor : {
                        type : 'my97'
                    }
                }
  • 相关阅读:
    python while 格式化 运算符 编码
    python 变量 if
    1、cad安装
    10、云存储—文件上传
    9、云函数
    8、云数据库
    8、小程序云开发
    7、页面交互js
    6、页面样式WXSS
    5、页面结构WXML
  • 原文地址:https://www.cnblogs.com/tv151579/p/2646002.html
Copyright © 2011-2022 走看看