[转][EasyUI]扩展 DateBox

/**
 * 给时间框控件扩展一个清除的按钮
 */
$.fn.datebox.defaults.cleanText = '清空';

(function ($) {
    var buttons = $.extend([], $.fn.datebox.defaults.buttons);
    buttons.splice(1, 0, {
        text: function (target) {
            return $(target).datebox("options").cleanText
        },
        handler: function (target) {
            $(target).datebox("setValue", "");
            $(target).datebox("hidePanel");
        }
    });
    $.extend($.fn.datebox.defaults, {
        buttons: buttons
    });

})(jQuery)

把以上代码放入 jquery.easyui.min.js 中即可。

转自:https://www.cnblogs.com/yeminglong/p/5264334.html

EasyUI 在 DateBox 有 Bug,需要在 data-options 属性里添加 editable:false

原文地址:https://www.cnblogs.com/z5337/p/9163331.html