. NET EasyUI datebox add clearing function

Source: Internet
Author: User

Preface some time ago, the project was built using the EasyUI framework and a series of its own components were used. But for datebox, there is not much to say about its functions. What makes it so painful is that it does not actually have the clearing function, which makes it difficult to set the date Conditions in the search area, now that this front-end framework is used, you have to solve the problem, so you thought of adding the clearing function by yourself. Some solutions and actual needs found on the Internet are summarized as follows. 1. jquery. easyui. min. js file modification (version jQuery EasyUI 1.3.3) (1) Row 11,361st: // define the Clear button for datebox $ ("<a href = \" javascript: void (0) \ "class = \" datebox-clean \ "> </a>" pai.html (opts. cleanText ). appendTo (_ 858); (2) 11,375th rows: // Add Event _ 858 for the datebox Clear button. find (". datebox-clean "). click (function () {$ (_ 853 ). combo ("setValue ",""). combo ("setText", ""); // sets the null value $ (_ 853 ). combo ("hidePanel"); // close the date Selection Panel after clicking the Clear button}); (3) Row 11,445th: // define the date. Select the button on the panel to display the text // clear Empty button to specify the default display text Clean currentText: "Today", cleanText: "Clean", closeText: "Close", okText: "OK" 2. easyui-lang-zh_CN.js (this is a Chinese package file) (1) 40th lines: $. fn. datebox. defaults. cleanText = 'clear & nbsp; '; // modify the datebox Clear button to display the text, add & nbsp; it is used to separate the clear and confirm button locations in datetimebox $. fn. datebox. defaults. okText = '& nbsp; '; (2) Row 67th: cleanText: $. fn. datebox. defaults. cleanText, // For the Clear button to know the default display text 3.easyui.css // find the eas in the folder under the selected easyui topic Add the following 1,528th lines to the yui.css file :. datebox-clean ,. datebox-clean {float: center;} follow the three steps above to confirm that they are correct. After saving them, you can see the effect. How can this problem be solved? You can clear it. Note: different versions of the jquery. easyui. min. js file may have different lines to be modified. Please check carefully. (Current version: jQuery EasyUI 1.3.3)

Related Article

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.