pbs: followup: actually set cbind for all elements

we cannot have xtype nor cbind in the defaults, as moving xtype there
breaks our cbind "when to stop descendant+apply" heuristic and cbind
cannot be moved there as it'd be only copied over by initComponent
and that happens later than the cbind apply step.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-17 19:21:14 +01:00
parent 158751a3b1
commit a090fe1d1d

View File

@ -118,22 +118,19 @@ Ext.define('PMG.PBSInputPanel', {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Last'), fieldLabel: gettext('Keep Last'),
name: 'keep-last', name: 'keep-last',
cbind: { cbind: { deleteEmpty: '{!isCreate}' },
deleteEmpty: (get) => !get('isCreate'),
},
}, },
{ {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Daily'), fieldLabel: gettext('Keep Daily'),
name: 'keep-daily', name: 'keep-daily',
cbind: { cbind: { deleteEmpty: '{!isCreate}' },
deleteEmpty: (get) => !get('isCreate'),
},
}, },
{ {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Monthly'), fieldLabel: gettext('Keep Monthly'),
name: 'keep-monthly', name: 'keep-monthly',
cbind: { deleteEmpty: '{!isCreate}' },
}, },
], ],
column2: [ column2: [
@ -141,16 +138,19 @@ Ext.define('PMG.PBSInputPanel', {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Hourly'), fieldLabel: gettext('Keep Hourly'),
name: 'keep-hourly', name: 'keep-hourly',
cbind: { deleteEmpty: '{!isCreate}' },
}, },
{ {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Weekly'), fieldLabel: gettext('Keep Weekly'),
name: 'keep-weekly', name: 'keep-weekly',
cbind: { deleteEmpty: '{!isCreate}' },
}, },
{ {
xtype: 'proxmoxintegerfield', xtype: 'proxmoxintegerfield',
fieldLabel: gettext('Keep Yearly'), fieldLabel: gettext('Keep Yearly'),
name: 'keep-yearly', name: 'keep-yearly',
cbind: { deleteEmpty: '{!isCreate}' },
}, },
], ],
}, },