fix edit button for some panels

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@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-02-07 10:11:22 +01:00
parent b6450910ce
commit 8cd96756d3
4 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ Ext.define('PVE.FirewallOptions', {
var edit_btn = new Ext.Button({ var edit_btn = new Ext.Button({
text: gettext('Edit'), text: gettext('Edit'),
disabled: true, disabled: true,
handler: me.run_editor handler: function() { me.run_editor(); }
}); });
var set_button_status = function() { var set_button_status = function() {

View File

@ -149,7 +149,7 @@ Ext.define('PVE.lxc.Options', {
var rowdef = rows[rec.data.key]; var rowdef = rows[rec.data.key];
return !!rowdef.editor; return !!rowdef.editor;
}, },
handler: me.run_editor handler: function() { me.run_editor(); }
}); });
Ext.apply(me, { Ext.apply(me, {

View File

@ -154,7 +154,7 @@ Ext.define('PVE.lxc.RessourceView', {
var rowdef = rows[rec.data.key]; var rowdef = rows[rec.data.key];
return !!rowdef.editor; return !!rowdef.editor;
}, },
handler: me.run_editor handler: function() { me.run_editor(); }
}); });
var resize_btn = new Proxmox.button.Button({ var resize_btn = new Proxmox.button.Button({

View File

@ -304,7 +304,7 @@ Ext.define('PVE.qemu.Options', {
var edit_btn = new Ext.Button({ var edit_btn = new Ext.Button({
text: gettext('Edit'), text: gettext('Edit'),
disabled: true, disabled: true,
handler: me.run_editor handler: function() { me.run_editor(); }
}); });
var revert_btn = new Proxmox.button.Button({ var revert_btn = new Proxmox.button.Button({