mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-12 03:26:17 +00:00
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:
parent
54fc2533c8
commit
121bbf57bf
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user