input panel: add onSetValues hook

As counter-part to `onGetValue`, which is for form assembly, add the
`onSetValues` helper that allows to hook into setting the values on
the fields, for example if one needs to transform a `disabled` to
`enable`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-11-15 15:16:39 +01:00
parent 54fc2533c8
commit 121bbf57bf

View File

@ -57,12 +57,18 @@ Ext.define('Proxmox.panel.InputPanel', {
}
},
onSetValues: function(values) {
return values;
},
setValues: function(values) {
let me = this;
let form = me.up('form');
Ext.iterate(values, function(fieldId, val) {
values = me.onSetValues(values);
Ext.iterate(values, function(fieldId, val) {
let fields = me.query('[isFormField][name=' + fieldId + ']');
for (const field of fields) {
if (field) {