[pve-devel] [PATCH pve-manager 6/6] fix storage selector 'change' event handling

Emmanuel Kasper e.kasper at proxmox.com
Wed Mar 9 15:57:17 CET 2016


the initial loading of the storage selector fires a 'change'
event via the 'onLoad' method of its parent class

at that point the value of the storage selector is empty,
and the callback function fails
---
 www/manager6/lxc/ResourceEdit.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index 270eb62..6fa56f0 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -332,6 +332,9 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
 	    hidden: me.unused || !me.create,
 	    listeners: {
 		change: function(f, value) {
+		    if (!value) { // initial store loading fires an unwanted 'change'
+			return;
+		    }
 		    if (me.mpdata.type === 'bind') {
 			me.quota.setDisabled(true);
 			me.quota.setValue(false);
-- 
2.1.4





More information about the pve-devel mailing list