[pve-devel] [PATCH pve-manager 1/2] Ext6migrate: move static configuration from instantiation time to class declaration time.

Emmanuel Kasper e.kasper at proxmox.com
Thu Dec 10 15:08:00 CET 2015


This fixes the problem that this ComboGrid was displayed with an empty value
( similar the to the Keyboard Selection and Realm Selection in the login window)
---
 www/manager6/form/GroupSelector.js   | 38 +++++++++++-----------
 www/manager6/form/StorageSelector.js | 61 ++++++++++++++++++------------------
 2 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/www/manager6/form/GroupSelector.js b/www/manager6/form/GroupSelector.js
index 0fc8d27..8404d5f 100644
--- a/www/manager6/form/GroupSelector.js
+++ b/www/manager6/form/GroupSelector.js
@@ -3,6 +3,25 @@ Ext.define('PVE.form.GroupSelector', {
     alias: ['widget.pveGroupSelector'],
 
     allowBlank: false,
+    autoSelect: false,
+    valueField: 'groupid',
+    displayField: 'groupid',
+    listConfig: {
+	columns: [
+	    {
+		header: gettext('Group'),
+		sortable: true,
+		dataIndex: 'groupid',
+		flex: 1
+	    },
+	    {
+		header: gettext('Comment'),
+		sortable: false,
+		dataIndex: 'comment',
+		flex: 1
+	    }
+	]
+    },
 
     initComponent: function() {
 	var me = this;
@@ -13,25 +32,6 @@ Ext.define('PVE.form.GroupSelector', {
 
 	Ext.apply(me, {
 	    store: store,
-	    autoSelect: false,
-	    valueField: 'groupid',
-	    displayField: 'groupid',
-            listConfig: {
-		columns: [
-		    {
-			header: gettext('Group'),
-			sortable: true,
-			dataIndex: 'groupid',
-			flex: 1
-		    },
-		    {
-			header: gettext('Comment'),
-			sortable: false,
-			dataIndex: 'comment',
-			flex: 1
-		    }
-		]
-	    }
 	});
 
         me.callParent();
diff --git a/www/manager6/form/StorageSelector.js b/www/manager6/form/StorageSelector.js
index 28b60ef..8c51bbb 100644
--- a/www/manager6/form/StorageSelector.js
+++ b/www/manager6/form/StorageSelector.js
@@ -2,6 +2,37 @@ Ext.define('PVE.form.StorageSelector', {
     extend: 'PVE.form.ComboGrid',
     alias: ['widget.PVE.form.StorageSelector'],
 
+    allowBlank: false,
+    valueField: 'storage',
+    displayField: 'storage',
+    listConfig: {
+	columns: [
+	    {
+		header: gettext('Name'),
+		dataIndex: 'storage',
+		hideable: false,
+		flex: 1
+	    },
+	    {
+		header: gettext('Type'),
+		width: 60,
+		dataIndex: 'type'
+	    },
+	    {
+		header: gettext('Avail'),
+		width: 80,
+		dataIndex: 'avail',
+		renderer: PVE.Utils.format_size
+	    },
+	    {
+		header: gettext('Capacity'),
+		width: 80,
+		dataIndex: 'total',
+		renderer: PVE.Utils.format_size
+	    }
+	]
+    },
+
     reloadStorageList: function() {
 	var me = this;
 	if (!me.nodename) {
@@ -67,36 +98,6 @@ Ext.define('PVE.form.StorageSelector', {
 
 	Ext.apply(me, {
 	    store: store,
-	    allowBlank: false,
-	    valueField: 'storage',
-	    displayField: 'storage',
-            listConfig: {
-		columns: [
-		    {
-			header: gettext('Name'),
-			dataIndex: 'storage',
-			hideable: false,
-			flex: 1
-		    },
-		    {
-			header: gettext('Type'),
-			width: 60, 
-			dataIndex: 'type'
-		    },
-		    {
-			header: gettext('Avail'),
-			width: 80, 
-			dataIndex: 'avail', 
-			renderer: PVE.Utils.format_size 
-		    },
-		    {
-			header: gettext('Capacity'),
-			width: 80, 
-			dataIndex: 'total', 
-			renderer: PVE.Utils.format_size 
-		    }
-		]
-	    }
 	});
 
         me.callParent();
-- 
2.1.4





More information about the pve-devel mailing list