Add a "clear" button for the Jeasyui date control----by modifying the easyui.min.js of 1.4

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.