Add a clear button for the Datebox or Datetimebox of jQuery Easyui 1.4
Usage Scenario: Specifies the date format for the user, and the date can be empty
To modify a language pack easyui-lang-zh_cn.js
In if ($.fn.datebox) {
Add (41 or 42 rows) to the next line
$.fn.datebox.defaults.cleantext = ' empty ';
In if ($.fn.datetimebox && $.fn.datebox) {
$.extend ($.fn.datetimebox.defaults,{
Add two lines below (67 lines)
Cleantext: $.fn.datebox.defaults.cleantext,
Search
}},currenttext: "Today", Closetext: "Close", Oktext: "OK", Buttons:[{text:function (_985) {
Revision changed to
}},currenttext: "Today", Cleantext: "Clean", Closetext: "Close", Oktext: "OK", Buttons:[{text:function (_985) {
Add an Element object to the buttons array above:
{text:function (_989) {
return $ (_989). Datebox ("Options"). Cleantext;
},handler:function (_990) {
$ (_990). Combo (' SetValue ', '). Combo (' SetText ', ');
$ (this). Closest ("Div.combo-panel"). Panel ("Close");
}}
Locate the buttons array for the Datetimebox control,
Add an element object to it
{text:function (_9A8) {
return $ (_9A8). Datetimebox ("Options"). Cleantext;
},
Handler:function (_9A9) {
$ (_9A9). Combo (' SetValue ', '). Combo (' SetText ', ');
$ (this). Closest ("Div.combo-panel"). Panel ("Close");
} }
Description: The position of the add element object determines the order of the buttons
: