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://*.com/questions/8191285/extjs-sencha-add-button-to-datefield-popup-to-clear-date