[pve-devel] [PATCH manager v2 2/4] ComboGrid: improve setting 'editable' default value

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 24 14:49:35 CEST 2017


This allows child classes to use another default, the initialConfig
didn't allowed that.
This is also the ExtJS like way to set defaults.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

changes v1 -> v2:
* new in v2

 www/manager6/form/ComboGrid.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/www/manager6/form/ComboGrid.js b/www/manager6/form/ComboGrid.js
index fbc318e5..18df7930 100644
--- a/www/manager6/form/ComboGrid.js
+++ b/www/manager6/form/ComboGrid.js
@@ -30,6 +30,8 @@ Ext.define('PVE.form.ComboGrid', {
     // needed to trigger onKeyUp etc.
     enableKeyEvents: true,
 
+    editable: false,
+
     // override ExtJS method
     // if the field has multiSelect enabled, the store is not loaded, and
     // the displayfield == valuefield, it saves the rawvalue as an array
@@ -254,10 +256,6 @@ Ext.define('PVE.form.ComboGrid', {
     initComponent: function() {
 	var me = this;
 
-	if (me.initialConfig.editable === undefined) {
-	    me.editable = false;
-	}
-
 	Ext.apply(me, {
 	    queryMode: 'local',
 	    matchFieldWidth: false
-- 
2.11.0





More information about the pve-devel mailing list