給datebox添加清空按鈕
阿新 • • 發佈:2018-10-08
class text jquery options 清空按鈕 hid return span col
//給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)
直接添加在文檔末尾即可
給datebox添加清空按鈕