EasyUI 1.3.6 DateBox add Clear button

Source: Internet
Author: User

EasyUI 1.3.6 DateBox add Clear button
EasyUI 1.3.6 DateBox add Clear button

Effect


EasyUI datebox does not have a clear button. You can add it as follows: <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD48cD608r + qanF1ZXJ5LmVhc3l1aS5taW4uanO/tLW91eLR + Today/Hangzhou "Today") and Close ("Close.

{Text: function (_ 947) {return $ (_ 947 ). datebox ("options "). cleanText;}, handler: function (_ 948) {$ (_ 948 ). combo ("setValue ",""). combo ("setText", ""); // sets the null value $ (_ 948 ). combo ("hidePanel"); // click the Clear button to close the date Selection Panel }},
Before adding the code, you can press Ctrl + Shift + F to format it. Otherwise, it is difficult to locate the location to be inserted. After the code is inserted, the context should be as follows:
CurrentText: "Today", closeText: "Close", okText: "OK", buttons: [{text: function (_ 945) {return $ (_ 945 ). datebox ("options "). currentText;}, handler: function (_ 946) {$ (_ 946 ). datebox ("calendar "). calendar ({year: new Date (). getFullYear (), month: new Date (). getMonth () + 1, current: new Date ()}); _ 935 (_ 946) ;},{ text: function (_ 947) {return $ (_ 947 ). datebox ("options "). cleanText;}, handler: function (_ 948) {$ (_ 948 ). combo ("setValue ",""). combo ("setText", ""); // sets the null value $ (_ 948 ). combo ("hidePanel"); // click the Clear button to close the date Selection Panel }}, {text: function (_ 947) {return $ (_ 947 ). datebox ("options "). closeText;}, handler: function (_ 948) {$ (this ). closest ("div. combo-panel "). panel ("close") ;}}],
Finally modify the easyui-lang-zh_CN.js file to add the following statement
$. Fn. datebox. defaults. cleanText = 'clear ';
Because it is clear to open this file, you should know where to add it.

PS: This method is available in EasyUI 1.3.6The version is passed. Other versions may be slightly different for your reference.



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.