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.