[pve-devel] [PATCH manager] fix edit button for some panels

Dominik Csapak d.csapak at proxmox.com
Wed Feb 7 10:13:58 CET 2018


when using the 'run_editor' function provided by the ObjectGrid,
we have to make sure the function runs in the context of the grid,
not in that of the button, else we cannot access the
selectionModel/rows/etc. of the grid

this happened with the switch to the widget toolkit

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/grid/FirewallOptions.js | 2 +-
 www/manager6/lxc/Options.js          | 2 +-
 www/manager6/lxc/Resources.js        | 2 +-
 www/manager6/qemu/Options.js         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/www/manager6/grid/FirewallOptions.js b/www/manager6/grid/FirewallOptions.js
index 87f6790c..819ebb8d 100644
--- a/www/manager6/grid/FirewallOptions.js
+++ b/www/manager6/grid/FirewallOptions.js
@@ -116,7 +116,7 @@ Ext.define('PVE.FirewallOptions', {
 	var edit_btn = new Ext.Button({
 	    text: gettext('Edit'),
 	    disabled: true,
-	    handler: me.run_editor
+	    handler: function() { me.run_editor(); }
 	});
 
 	var set_button_status = function() {
diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index 0633f9f1..3a9959fe 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -149,7 +149,7 @@ Ext.define('PVE.lxc.Options', {
 		var rowdef = rows[rec.data.key];
 		return !!rowdef.editor;
 	    },
-	    handler: me.run_editor
+	    handler: function() { me.run_editor(); }
 	});
 
 	Ext.apply(me, {
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 58482779..d2835a27 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -154,7 +154,7 @@ Ext.define('PVE.lxc.RessourceView', {
 		var rowdef = rows[rec.data.key];
 		return !!rowdef.editor;
 	    },
-	    handler: me.run_editor
+	    handler: function() { me.run_editor(); }
 	});
 
 	var resize_btn = new Proxmox.button.Button({
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index 5b8b5dc4..6f0b2511 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -304,7 +304,7 @@ Ext.define('PVE.qemu.Options', {
 	var edit_btn = new Ext.Button({
 	    text: gettext('Edit'),
 	    disabled: true,
-	    handler: me.run_editor
+	    handler: function() { me.run_editor(); }
 	});
 
         var revert_btn = new Proxmox.button.Button({
-- 
2.11.0





More information about the pve-devel mailing list