[pve-devel] [PATCH manager 1/3] fix #943: allow saving of values

Dominik Csapak d.csapak at proxmox.com
Mon Apr 25 09:47:47 CEST 2016


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 at proxmox.com>
---
 www/manager6/qemu/BootOrderEdit.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/BootOrderEdit.js b/www/manager6/qemu/BootOrderEdit.js
index 2eeb22a..783a3aa 100644
--- a/www/manager6/qemu/BootOrderEdit.js
+++ b/www/manager6/qemu/BootOrderEdit.js
@@ -6,6 +6,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
     bootdisk: undefined,
     selection: [],
     list: [],
+    comboboxes: [],
 
     setVMConfig: function(vmconfig) {
 	var me = this;
@@ -31,6 +32,10 @@ Ext.define('PVE.qemu.BootOrderPanel', {
 	me.list.push(['__none__', PVE.Utils.noneText]);
 
 	me.recomputeList();
+
+	me.comboboxes.forEach(function(box) {
+	    box.resetOriginalValue();
+	});
     },
 
     onGetValues: function(values) {
@@ -86,7 +91,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
 	    } else {
 		item.store.loadData(me.list);
 	    }
-	    item.suspendEvents(false);
+	    item.suspendEvent('change');
 	    if (cnt < me.selection.length) {
 		item.setValue((me.selection[cnt] !== 'c')?me.selection[cnt]:me.bootdisk);
 	    } else if (cnt === 0){
@@ -95,7 +100,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
 		item.setValue('__none__');
 	    }
 	    cnt++;
-	    item.resumeEvents(true);
+	    item.resumeEvent('change');
 	    item.validate();
 	});
     },
-- 
2.1.4





More information about the pve-devel mailing list