fix #4534: add clear trigger for simpler clearing schedule

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-02-17 12:27:04 +01:00
parent 9a741dd8ea
commit 63599af160

View File

@ -49,6 +49,25 @@ Ext.define('PBS.form.CalendarEvent', {
return data;
},
triggers: {
clear: {
cls: 'pmx-clear-trigger',
weight: -1,
hidden: true,
handler: function() {
this.triggers.clear.setVisible(false);
this.setValue('');
},
},
},
listeners: {
change: function(field, value) {
let canClear = (value ?? '') !== '';
field.triggers.clear.setVisible(canClear);
},
},
store: {
type: 'calendarEventExamples',
},