mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-15 02:04:35 +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) {
|
setValues: function(values) {
|
||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
let form = me.up('form');
|
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 + ']');
|
let fields = me.query('[isFormField][name=' + fieldId + ']');
|
||||||
for (const field of fields) {
|
for (const field of fields) {
|
||||||
if (field) {
|
if (field) {
|
||||||
|
Loading…
Reference in New Issue
Block a user