效果图
easyui datebox控件没有清空按钮,感觉是个缺陷,通过如下方法可以加入
修改jquery.easyui.min.js,找到时间控件,在今天与关闭中间添加清空。
搜索currentText
在10100行加入如下行
$("<a href=\"javascript:void(0)\" class=\"datebox-clean\"></a>").html(opts.cleanText).appendTo(_756);
加入datebox-clean的单击事件
_756.find(".datebox-clean").click(function(){
$(_751).combo("setValue","").combo("setText","");
$(_751).combo("hidePanel");
});
添加Clean文字,
搜索currentText,加入cleanText:"Clean"
currentText:"Today",cleanText:"Clean",closeText:"Close",okText:"Ok"
修改jquery-easyui-1.2.6/locale/easyui-lang-zh_CN.js
//代码行数41,加入清空
$.fn.datebox.defaults.cleanText = '清空';
修改CSS样式,添加清空样式,
jquery-easyui-1.2.6/themes/default/easyui.css
.datebox-clean {
color:#888;
text-decoration:none;
font-weight:bold;
float: center;
}
OK,运行看看效果!!!
jquery-easyui-1.3.4版本请参考
http://www.kankanews.com/ICkengine/archives/92892.shtml