fix #943: allow saving of values
we mistakenly did not reset the originalvalues after the inital load, which meant that on reset we would not get the correct values furthermore we have to suspend only the change event and not all, otherwise the functions for enabling/disabling the ok/reset buttons do not trigger (on validitychange and dirtychange) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
d50472438d
commit
9e7b4d8dc5
@ -6,6 +6,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
|||||||
bootdisk: undefined,
|
bootdisk: undefined,
|
||||||
selection: [],
|
selection: [],
|
||||||
list: [],
|
list: [],
|
||||||
|
comboboxes: [],
|
||||||
|
|
||||||
setVMConfig: function(vmconfig) {
|
setVMConfig: function(vmconfig) {
|
||||||
var me = this;
|
var me = this;
|
||||||
@ -31,6 +32,10 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
|||||||
me.list.push(['__none__', PVE.Utils.noneText]);
|
me.list.push(['__none__', PVE.Utils.noneText]);
|
||||||
|
|
||||||
me.recomputeList();
|
me.recomputeList();
|
||||||
|
|
||||||
|
me.comboboxes.forEach(function(box) {
|
||||||
|
box.resetOriginalValue();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onGetValues: function(values) {
|
onGetValues: function(values) {
|
||||||
@ -86,7 +91,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
|||||||
} else {
|
} else {
|
||||||
item.store.loadData(me.list);
|
item.store.loadData(me.list);
|
||||||
}
|
}
|
||||||
item.suspendEvents(false);
|
item.suspendEvent('change');
|
||||||
if (cnt < me.selection.length) {
|
if (cnt < me.selection.length) {
|
||||||
item.setValue((me.selection[cnt] !== 'c')?me.selection[cnt]:me.bootdisk);
|
item.setValue((me.selection[cnt] !== 'c')?me.selection[cnt]:me.bootdisk);
|
||||||
} else if (cnt === 0){
|
} else if (cnt === 0){
|
||||||
@ -95,7 +100,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
|||||||
item.setValue('__none__');
|
item.setValue('__none__');
|
||||||
}
|
}
|
||||||
cnt++;
|
cnt++;
|
||||||
item.resumeEvents(true);
|
item.resumeEvent('change');
|
||||||
item.validate();
|
item.validate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user