ExtJs DateField 清空按钮
作者:互联网
function showDateClrBtn(ctl){
Ext.form.DateField.prototype.onTriggerClick.apply(this, arguments);
let ctlid=ctl.id;
let hasbtn =ctl.picker.todayBtn.container.child('#'+ctlid+'_clrbtn');
if(!hasbtn){
hasbtn= new Ext.Button({
text: '清空'
,id:ctlid+'_clrbtn'
,handler:function(){
ctl.clear();
}
});hasbtn.render(ctl.picker.todayBtn.container);
}}
使用并初始化:
App.yourdatefieldcontrol.onTriggerClick=showDateClrBtn
https://stackoverflow.com/questions/8191285/extjs-sencha-add-button-to-datefield-popup-to-clear-date
标签:picker,DateField,ctlid,hasbtn,清空,ctl,clrbtn,ExtJs 来源: https://www.cnblogs.com/wkk2020/p/14051856.html